Ticket #6256: remove-64bit-helpers-mythtv.diff
File remove-64bit-helpers-mythtv.diff, 31.1 KB (added by , 15 years ago) |
---|
-
libs/libmythtv/NuppelVideoPlayer.cpp
40 40 #include "fifowriter.h" 41 41 #include "filtermanager.h" 42 42 #include "util.h" 43 #include "decodeencode.h"44 43 #include "livetvchain.h" 45 44 #include "decoderbase.h" 46 45 #include "nuppeldecoder.h" -
libs/libmythtv/previewgenerator.cpp
27 27 #include "remotefile.h" 28 28 #include "storagegroup.h" 29 29 #include "util.h" 30 #include "decodeencode.h"31 30 #include "playercontext.h" 32 31 #include "mythdirs.h" 33 32 #include "mythverbose.h" … … 304 303 QStringList strlist( "QUERY_GENPIXMAP" ); 305 304 programInfo.ToStringList(strlist); 306 305 strlist.push_back(timeInSeconds ? "s" : "f"); 307 encodeLongLong(strlist, captureTime);306 strlist.push_back(QString::number(captureTime)); 308 307 if (outFileName.isEmpty()) 309 308 { 310 309 strlist.push_back("<EMPTY>"); -
libs/libmythtv/programlist.cpp
416 416 proginfo->chanOutputFilters = query.value(20).toString(); 417 417 proginfo->seriesid = query.value(21).toString(); 418 418 proginfo->programid = query.value(22).toString(); 419 proginfo->filesize = stringToLongLong(query.value(23).toString());419 proginfo->filesize = query.value(23).toLongLong(); 420 420 proginfo->lastmodified = QDateTime::fromString(query.value(24).toString(), Qt::ISODate); 421 421 proginfo->findid = query.value(25).toInt(); 422 422 -
libs/libmythtv/remoteencoder.cpp
6 6 #include "remoteencoder.h" 7 7 #include "programinfo.h" 8 8 #include "util.h" 9 #include "decodeencode.h"10 9 #include "mythcontext.h" 11 10 #include "signalmonitor.h" 12 11 #include "videooutbase.h" … … 184 183 QStringList strlist( QString("QUERY_RECORDER %1").arg(recordernum)); 185 184 strlist << "GET_FRAMES_WRITTEN"; 186 185 187 if (!SendReceiveStringList(strlist, 2))186 if (!SendReceiveStringList(strlist, 1)) 188 187 { 189 188 VERBOSE(VB_IMPORTANT, LOC_ERR + "GetFramesWritten() -- network error"); 190 189 return -1; 191 190 } 192 191 193 if (1 == strlist.size()) 194 { 195 VERBOSE(VB_IMPORTANT, LOC_ERR + 196 QString("GetFramesWritten() -- server ret: %1") 197 .arg(strlist[0])); 198 return -1; 199 } 200 201 cachedFramesWritten = decodeLongLong(strlist, 0); 192 cachedFramesWritten = strlist[0].toLongLong(); 202 193 return cachedFramesWritten; 203 194 } 204 195 … … 213 204 QStringList strlist( QString("QUERY_RECORDER %1").arg(recordernum)); 214 205 strlist << "GET_FILE_POSITION"; 215 206 216 if (SendReceiveStringList(strlist, 2))217 return decodeLongLong(strlist, 0);207 if (SendReceiveStringList(strlist, 1)) 208 return strlist[0].toLongLong(); 218 209 219 210 return -1; 220 211 } … … 228 219 QStringList strlist( QString("QUERY_RECORDER %1").arg(recordernum)); 229 220 strlist << "GET_MAX_BITRATE"; 230 221 231 if (SendReceiveStringList(strlist, 2))232 return decodeLongLong(strlist, 0);222 if (SendReceiveStringList(strlist, 1)) 223 return strlist[0].toLongLong(); 233 224 234 225 return 20200000LL; // Peek bit rate for HD-PVR 235 226 } … … 245 236 { 246 237 QStringList strlist( QString("QUERY_RECORDER %1").arg(recordernum) ); 247 238 strlist << "GET_KEYFRAME_POS"; 248 encodeLongLong(strlist,desired);239 strlist << QString::number(desired); 249 240 250 if (SendReceiveStringList(strlist, 2))251 return decodeLongLong(strlist, 0);241 if (SendReceiveStringList(strlist, 1)) 242 return strlist[0].toLongLong(); 252 243 253 244 return -1; 254 245 } -
libs/libmythtv/remoteutil.cpp
7 7 #include "inputinfo.h" 8 8 #include "programinfo.h" 9 9 #include "mythcontext.h" 10 #include "decodeencode.h"11 10 #include "remoteencoder.h" 12 11 #include "tv_rec.h" 13 12 … … 85 84 fsInfo.isLocal = (*(it++)).toInt(); 86 85 fsInfo.fsID = (*(it++)).toInt(); 87 86 fsInfo.dirID = (*(it++)).toInt(); 88 fsInfo.totalSpaceKB = decodeLongLong(strlist, it);89 fsInfo.usedSpaceKB = decodeLongLong(strlist, it);87 fsInfo.totalSpaceKB = (*(it++)).toLongLong(); 88 fsInfo.usedSpaceKB = (*(it++)).toLongLong(); 90 89 fsInfos.push_back(fsInfo); 91 90 } 92 91 } -
libs/libmythtv/programinfo.cpp
585 585 tmpSize += QObject::tr("GB", "GigaBytes"); 586 586 progMap["filesize_str"] = tmpSize; 587 587 588 progMap["filesize"] = longLongToString(filesize);588 progMap["filesize"] = QString::number(filesize); 589 589 590 590 if (isVideo) 591 591 { … … 954 954 proginfo->chanOutputFilters = query.value(10).toString(); 955 955 proginfo->seriesid = query.value(11).toString(); 956 956 proginfo->programid = query.value(12).toString(); 957 proginfo->filesize = stringToLongLong(query.value(13).toString());957 proginfo->filesize = query.value(13).toLongLong(); 958 958 959 959 proginfo->lastmodified = 960 960 QDateTime::fromString(query.value(14).toString(), … … 1954 1954 query.prepare("UPDATE recorded SET filesize = :FILESIZE" 1955 1955 " WHERE chanid = :CHANID" 1956 1956 " AND starttime = :STARTTIME ;"); 1957 query.bindValue(":FILESIZE", longLongToString(fsize));1957 query.bindValue(":FILESIZE", fsize); 1958 1958 query.bindValue(":CHANID", chanid); 1959 1959 query.bindValue(":STARTTIME", recstartts); 1960 1960 … … 1978 1978 if (query.exec() && query.isActive() && query.size() > 0) 1979 1979 { 1980 1980 query.next(); 1981 filesize = stringToLongLong(query.value(0).toString());1981 filesize = query.value(0).toLongLong(); 1982 1982 } 1983 1983 else 1984 1984 filesize = 0; -
libs/libmyth/util.h
35 35 MPUBLIC QDateTime MythUTCToLocal(const QDateTime &utc); 36 36 MPUBLIC int MythSecsTo(const QDateTime &from, const QDateTime &to); 37 37 38 MPUBLIC long long stringToLongLong(const QString &str); 39 MPUBLIC QString longLongToString(long long ll); 38 MPUBLIC inline long long absLongLong(long long n) { return n >= 0 ? n : -n; } 40 39 41 40 MPUBLIC long long getDiskSpace(const QString&,long long&,long long&); 42 41 MPUBLIC bool getUptime(time_t &uptime); -
libs/libmyth/util.cpp
437 437 return true; 438 438 } 439 439 440 /** \fn encodeLongLong(QStringList&,long long)441 * \brief Encodes a long for streaming in the MythTV protocol.442 *443 * We need this for Qt3.1 compatibility, since it will not444 * print or read a 64 bit number directly.445 * We encode the long long as strings representing two signed446 * 32 bit integers.447 *448 * \sa decodeLongLong(QStringList&,uint)449 * decodeLongLong(QStringList&,QStringList::const_iterator&)450 */451 void encodeLongLong(QStringList &list, long long num)452 {453 list << QString::number((int)(num >> 32));454 list << QString::number((int)(num & 0xffffffffLL));455 }456 457 /** \fn decodeLongLong(QStringList&,uint)458 * \brief Inefficiently decodes a long encoded for streaming in the MythTV protocol.459 *460 * We need this for Qt3.1 compatibility, since it will not461 * print or read a 64 bit number directly.462 *463 * The long long is represented as two signed 32 bit integers.464 *465 * Note: This decode performs two O(n) linear searches of the list,466 * The iterator decode function is much more efficient.467 *468 * \param list List to search for offset and offset+1 in.469 * \param offset Offset in list where to find first 32 bits of470 * long long.471 * \sa encodeLongLong(QStringList&,long long),472 * decodeLongLong(QStringList&,QStringList::const_iterator&)473 */474 long long decodeLongLong(QStringList &list, uint offset)475 {476 long long retval = 0;477 if (offset >= (uint)list.size())478 {479 VERBOSE(VB_IMPORTANT,480 "decodeLongLong() called with offset >= list size.");481 return retval;482 }483 484 int l1 = list[offset].toInt();485 int l2 = list[offset + 1].toInt();486 487 retval = ((long long)(l2) & 0xffffffffLL) | ((long long)(l1) << 32);488 489 return retval;490 }491 492 /** \fn decodeLongLong(QStringList&,QStringList::const_iterator&)493 * \brief Decodes a long encoded for streaming in the MythTV protocol.494 *495 * We need this for Qt3.1 compatibility, since it will not496 * print or read a 64 bit number directly.497 *498 * The long long is represented as two signed 32 bit integers.499 *500 * \param list List to search for offset and offset+1 in.501 * \param it Iterator pointing to first 32 bits of long long.502 * \sa encodeLongLong(QStringList&,long long),503 * decodeLongLong(QStringList&,uint)504 */505 long long decodeLongLong(QStringList &list, QStringList::const_iterator &it)506 {507 (void)list;508 509 long long retval = 0;510 511 bool ok = true;512 int l1=0, l2=0;513 514 if (it == list.end())515 ok = false;516 else517 l1 = (*(it++)).toInt();518 519 if (it == list.end())520 ok = false;521 else522 l2 = (*(it++)).toInt();523 524 if (!ok)525 {526 VERBOSE(VB_IMPORTANT,527 "decodeLongLong() called with the iterator too close "528 "to the end of the list.");529 return 0;530 }531 532 retval = ((long long)(l2) & 0xffffffffLL) | ((long long)(l1) << 32);533 534 return retval;535 }536 537 440 /** \fn blendColors(QRgb source, QRgb add, int alpha) 538 441 * \brief Inefficient alpha blending function. 539 442 */ … … 610 513 return localdt; 611 514 } 612 515 613 /** \fn stringToLongLong(const QString &str)614 * \brief Converts QString representing long long to a long long.615 *616 * This is needed to input 64 bit numbers with Qt 3.1.617 */618 long long stringToLongLong(const QString &str)619 {620 long long retval = 0;621 if (str != QString::null)622 {623 QByteArray tmp = str.toAscii();624 retval = strtoll(tmp.constData(), NULL, 0);625 }626 return retval;627 }628 629 /** \fn longLongToString(long long)630 * \brief Returns QString representation of long long.631 *632 * This is needed to output 64 bit numbers with Qt 3.1.633 */634 QString longLongToString(long long ll)635 {636 char str[21];637 snprintf(str, 20, "%lld", ll);638 str[20] = '\0';639 return str;640 }641 642 516 /** \fn getUptime(time_t&) 643 517 * \brief Returns uptime statistics. 644 518 * \todo Update Statistics are not supported (by MythTV) on NT or DOS. -
libs/libmyth/storagegroup.cpp
325 325 VERBOSE(VB_FILE, LOC + 326 326 QString("FindNextDirMostFree: '%1' has %2 KiB free") 327 327 .arg(m_dirlist[curDir]) 328 .arg( longLongToString(thisDirFree)));328 .arg(QString::number(thisDirFree))); 329 329 330 330 if (thisDirFree > nextDirFree) 331 331 { -
libs/libmythdb/decodeencode.h
1 #ifndef DECODEENCODE_H_2 #define DECODEENCODE_H_3 4 #include <algorithm>5 using namespace std;6 7 #include <qstringlist.h>8 9 // This is necessary for GCC 3.3, which has llabs(long long)10 // // but not abs(long long) or std::llabs(long long)11 MPUBLIC inline long long absLongLong(long long n) { return n >= 0 ? n : -n; }12 13 MPUBLIC void encodeLongLong(QStringList &list, long long num);14 MPUBLIC long long decodeLongLong(QStringList &list, uint offset);15 MPUBLIC long long decodeLongLong(QStringList &list, QStringList::const_iterator &it);16 17 #endif // DECODEENCODE_H_ -
libs/libmythdb/decodeencode.cpp
1 // C++ headers2 #include <iostream>3 4 using namespace std;5 6 // C headers7 #include <cerrno>8 #include <unistd.h>9 #include <stdlib.h>10 #include <fcntl.h>11 #include <time.h>12 13 // System specific C headers14 #include "compat.h"15 16 // Qt headers17 #include <QApplication>18 #include <QImage>19 #include <QPainter>20 #include <QPixmap>21 #include <QFont>22 #include <QFile>23 #include <QDir>24 #include <QFileInfo>25 26 #include "mythverbose.h"27 28 /** \fn encodeLongLong(QStringList&,long long)29 * \brief Encodes a long for streaming in the MythTV protocol.30 *31 * We need this for Qt3.1 compatibility, since it will not32 * print or read a 64 bit number directly.33 * We encode the long long as strings representing two signed34 * 32 bit integers.35 *36 * \sa decodeLongLong(QStringList&,uint)37 * decodeLongLong(QStringList&,QStringList::const_iterator&)38 */39 void encodeLongLong(QStringList &list, long long num)40 {41 list << QString::number((int)(num >> 32));42 list << QString::number((int)(num & 0xffffffffLL));43 }44 45 /** \fn decodeLongLong(QStringList&,uint)46 * \brief Inefficiently decodes a long encoded for streaming in the MythTV protocol.47 *48 * We need this for Qt3.1 compatibility, since it will not49 * print or read a 64 bit number directly.50 *51 * The long long is represented as two signed 32 bit integers.52 *53 * Note: This decode performs two O(n) linear searches of the list,54 * The iterator decode function is much more efficient.55 *56 * \param list List to search for offset and offset+1 in.57 * \param offset Offset in list where to find first 32 bits of58 * long long.59 * \sa encodeLongLong(QStringList&,long long),60 * decodeLongLong(QStringList&,QStringList::const_iterator&)61 */62 long long decodeLongLong(QStringList &list, uint offset)63 {64 long long retval = 0;65 if (offset >= (uint)list.size())66 {67 VERBOSE(VB_IMPORTANT,68 "decodeLongLong() called with offset >= list size.");69 return retval;70 }71 72 int l1 = list[offset].toInt();73 int l2 = list[offset + 1].toInt();74 75 retval = ((long long)(l2) & 0xffffffffLL) | ((long long)(l1) << 32);76 77 return retval;78 }79 80 /** \fn decodeLongLong(QStringList&,QStringList::const_iterator&)81 * \brief Decodes a long encoded for streaming in the MythTV protocol.82 *83 * We need this for Qt3.1 compatibility, since it will not84 * print or read a 64 bit number directly.85 *86 * The long long is represented as two signed 32 bit integers.87 *88 * \param list List to search for offset and offset+1 in.89 * \param it Iterator pointing to first 32 bits of long long.90 * \sa encodeLongLong(QStringList&,long long),91 * decodeLongLong(QStringList&,uint)92 */93 long long decodeLongLong(QStringList &list, QStringList::const_iterator &it)94 {95 (void)list;96 97 long long retval = 0;98 99 bool ok = true;100 int l1=0, l2=0;101 102 if (it == list.end())103 ok = false;104 else105 l1 = (*(it++)).toInt();106 107 if (it == list.end())108 ok = false;109 else110 l2 = (*(it++)).toInt();111 112 if (!ok)113 {114 VERBOSE(VB_IMPORTANT,115 "decodeLongLong() called with the iterator too close "116 "to the end of the list.");117 return 0;118 }119 120 retval = ((long long)(l2) & 0xffffffffLL) | ((long long)(l1) << 32);121 122 return retval;123 }124 125 /** \fn stringToLongLong(const QString &str)126 * \brief Converts QString representing long long to a long long.127 *128 * This is needed to input 64 bit numbers with Qt 3.1.129 */130 long long stringToLongLong(const QString &str)131 {132 long long retval = 0;133 if (str != QString::null)134 {135 QByteArray tmp = str.toAscii();136 retval = strtoll(tmp.constData(), NULL, 0);137 }138 return retval;139 }140 141 /** \fn longLongToString(long long)142 * \brief Returns QString representation of long long.143 *144 * This is needed to output 64 bit numbers with Qt 3.1.145 */146 QString longLongToString(long long ll)147 {148 char str[21];149 snprintf(str, 20, "%lld", ll);150 str[20] = '\0';151 return str;152 }153 -
libs/libmythdb/remotefile.cpp
6 6 7 7 #include "mythdb.h" 8 8 #include "remotefile.h" 9 #include "decodeencode.h"10 // #include "mythcontext.h"11 9 #include "mythsocket.h" 12 10 #include "compat.h" 13 11 #include "mythverbose.h" … … 96 94 } 97 95 98 96 recordernum = strlist[1].toInt(); 99 filesize = decodeLongLong(strlist, 2);97 filesize = strlist[2].toLongLong(); 100 98 } 101 99 102 100 return lsock; … … 180 178 181 179 QStringList strlist( QString(query).arg(recordernum) ); 182 180 strlist << "SEEK"; 183 encodeLongLong(strlist,pos);181 strlist << QString::number(pos); 184 182 strlist << QString::number(whence); 185 183 if (curpos > 0) 186 encodeLongLong(strlist,curpos);184 strlist << QString::number(curpos); 187 185 else 188 encodeLongLong(strlist,readposition);186 strlist << QString::number(readposition); 189 187 190 188 lock.lock(); 191 189 controlSock->writeStringList(strlist); 192 190 controlSock->readStringList(strlist); 193 191 lock.unlock(); 194 192 195 long long retval = decodeLongLong(strlist, 0);193 long long retval = strlist[0].toLongLong(); 196 194 readposition = retval; 197 195 198 196 Reset(); -
libs/libmythdb/libmythdb.pro
15 15 HEADERS += mythobservable.h mythevent.h httpcomms.h qcodecs.h 16 16 HEADERS += mythtimer.h mythdirs.h mythsocket.h lcddevice.h 17 17 HEADERS += exitcodes.h msocketdevice.h mythstorage.h 18 HEADERS += remotefile.h decodeencode.h18 HEADERS += remotefile.h 19 19 20 20 SOURCES += mythdbcon.cpp mythdb.cpp oldsettings.cpp mythverbose.cpp 21 21 SOURCES += mythobservable.cpp httpcomms.cpp qcodecs.cpp mythdirs.cpp 22 22 SOURCES += msocketdevice.cpp mythsocket.cpp lcddevice.cpp mythstorage.cpp 23 SOURCES += remotefile.cpp decodeencode.cpp23 SOURCES += remotefile.cpp 24 24 25 25 win32:SOURCES += msocketdevice_win.cpp 26 26 unix:SOURCES += msocketdevice_unix.cpp -
programs/mythcommflag/BlankFrameDetector.cpp
4 4 5 5 // MythTV headers 6 6 #include "mythcontext.h" /* gContext */ 7 #include "decodeencode.h" /* for absLongLong */8 7 #include "NuppelVideoPlayer.h" 9 8 10 9 // Commercial Flagging headers -
programs/mythbackend/mythxml.cpp
1643 1643 program.setAttribute( "seriesId" , pInfo->seriesid ); 1644 1644 program.setAttribute( "programId" , pInfo->programid ); 1645 1645 program.setAttribute( "stars" , pInfo->stars ); 1646 program.setAttribute( "fileSize" , 1647 longLongToString( pInfo->filesize ));1646 program.setAttribute( "fileSize" , 1647 QString::number( pInfo->filesize )); 1648 1648 program.setAttribute( "lastModified", 1649 1649 pInfo->lastmodified.toString(Qt::ISODate) ); 1650 1650 program.setAttribute( "programFlags", pInfo->programflags ); -
programs/mythbackend/upnpcdstv.cpp
252 252 QString sCategory = query.value( 6).toString(); 253 253 QString sHostName = query.value( 7).toString(); 254 254 QString sRecGroup = query.value( 8).toString(); 255 long long nFileSize = stringToLongLong( query.value( 9).toString());255 long long nFileSize = query.value( 9).toLongLong(); 256 256 QString sBaseName = query.value(10).toString(); 257 257 258 258 QDateTime dtProgStart = query.value(11).toDateTime(); … … 362 362 363 363 364 364 pRes->AddAttribute( "duration" , sDur ); 365 pRes->AddAttribute( "size" , longLongToString(nFileSize) );365 pRes->AddAttribute( "size" , QString::number(nFileSize) ); 366 366 367 367 /* 368 368 // ---------------------------------------------------------------------- -
programs/mythbackend/playbacksock.cpp
11 11 #include "mythcontext.h" 12 12 #include "util.h" 13 13 #include "inputinfo.h" 14 #include "decodeencode.h"15 14 16 15 #define LOC QString("PlaybackSock: ") 17 16 #define LOC_ERR QString("PlaybackSock, Error: ") … … 201 200 QStringList strlist(QString("QUERY_GENPIXMAP")); 202 201 pginfo->ToStringList(strlist); 203 202 strlist.push_back(time_fmt_sec ? "s" : "f"); 204 encodeLongLong(strlist, time);203 strlist.push_back(QString::number(time)); 205 204 strlist.push_back((outputFile.isEmpty()) ? "<EMPTY>" : outputFile); 206 205 strlist.push_back(QString::number(outputSize.width())); 207 206 strlist.push_back(QString::number(outputSize.height())); … … 289 288 290 289 SendReceiveStringList(strlist); 291 290 292 long long ret = decodeLongLong(strlist, 0);291 long long ret = strlist[0].toLongLong(); 293 292 return ret; 294 293 } 295 294 -
programs/mythbackend/mainserver.cpp
44 44 #include "mythcontext.h" 45 45 #include "mythverbose.h" 46 46 #include "mythversion.h" 47 #include "decodeencode.h"48 47 #include "mythdb.h" 49 48 50 49 #include "mainserver.h" … … 1085 1084 1086 1085 retlist << QString::number(socket->socket()); 1087 1086 ft->UpRef(); 1088 encodeLongLong(retlist,ft->GetFileSize());1087 retlist << QString::number(ft->GetFileSize()); 1089 1088 ft->DownRef(); 1090 1089 } 1091 1090 … … 1247 1246 proginfo->chanOutputFilters = query.value(20).toString(); 1248 1247 proginfo->seriesid = query.value(21).toString(); 1249 1248 proginfo->programid = query.value(22).toString(); 1250 proginfo->filesize = stringToLongLong(query.value(23).toString());1249 proginfo->filesize = query.value(23).toLongLong(); 1251 1250 proginfo->lastmodified = 1252 1251 QDateTime::fromString(query.value(24).toString(), 1253 1252 Qt::ISODate); … … 3059 3058 } 3060 3059 else if (command == "GET_FRAMES_WRITTEN") 3061 3060 { 3062 long long value = enc->GetFramesWritten(); 3063 encodeLongLong(retlist, value); 3061 retlist << QString::number(enc->GetFramesWritten()); 3064 3062 } 3065 3063 else if (command == "GET_FILE_POSITION") 3066 3064 { 3067 long long value = enc->GetFilePosition(); 3068 encodeLongLong(retlist, value); 3065 retlist << QString::number(enc->GetFilePosition()); 3069 3066 } 3070 3067 else if (command == "GET_MAX_BITRATE") 3071 3068 { 3072 long long value = enc->GetMaxBitrate(); 3073 encodeLongLong(retlist, value); 3069 retlist << QString::number(enc->GetMaxBitrate()); 3074 3070 } 3075 3071 else if (command == "GET_CURRENT_RECORDING") 3076 3072 { … … 3088 3084 } 3089 3085 else if (command == "GET_KEYFRAME_POS") 3090 3086 { 3091 long long desired = decodeLongLong(slist, 2); 3092 3093 long long value = enc->GetKeyframePosition(desired); 3094 encodeLongLong(retlist, value); 3087 long long desired = slist[2].toLongLong(); 3088 retlist << QString::number(enc->GetKeyframePosition(desired)); 3095 3089 } 3096 3090 else if (command == "FILL_POSITION_MAP") 3097 3091 { … … 3514 3508 } 3515 3509 else if (command == "GET_MAX_BITRATE") 3516 3510 { 3517 long long value = enc->GetMaxBitrate(); 3518 encodeLongLong(retlist, value); 3511 retlist << QString::number(enc->GetMaxBitrate()); 3519 3512 } 3520 3513 else if (command == "GET_CURRENT_RECORDING") 3521 3514 { … … 3605 3598 rowcnt++; 3606 3599 QString intstr = QString("%1").arg(*it); 3607 3600 retlist << intstr; 3608 encodeLongLong(retlist,it.key());3601 retlist << QString::number(it.key()); 3609 3602 } 3610 3603 } 3611 3604 … … 3675 3668 if (pginfo) 3676 3669 bookmark = pginfo->GetBookmark(); 3677 3670 3678 encodeLongLong(retlist,bookmark);3671 retlist << QString::number(bookmark); 3679 3672 3680 3673 if (pbssock) 3681 3674 SendResponse(pbssock, retlist); … … 3700 3693 3701 3694 QString chanid = tokens[1]; 3702 3695 QString starttime = tokens[2]; 3703 QStringList bookmarklist; 3704 bookmarklist << tokens[3]; 3705 bookmarklist << tokens[4]; 3696 long long bookmark = tokens[3].toLongLong(); 3706 3697 3707 3698 QDateTime startdt; 3708 3699 startdt.setTime_t(starttime.toULongLong()); 3709 3700 QStringList retlist; 3710 long long bookmark = decodeLongLong(bookmarklist, 0);3711 3701 3712 3702 ProgramInfo *pginfo = ProgramInfo::GetProgramFromRecorded(chanid, 3713 3703 startdt); … … 3814 3804 } 3815 3805 else if (command == "SEEK") 3816 3806 { 3817 long long pos = decodeLongLong(slist, 2);3818 int whence = slist[ 4].toInt();3819 long long curpos = decodeLongLong(slist, 5);3807 long long pos = slist[2].toLongLong(); 3808 int whence = slist[3].toInt(); 3809 long long curpos = slist[4].toLongLong(); 3820 3810 3821 3811 long long ret = ft->Seek(curpos, pos, whence); 3822 encodeLongLong(retlist,ret);3812 retlist << QString::number(ret); 3823 3813 } 3824 3814 else if (command == "SET_TIMEOUT") 3825 3815 { … … 3997 3987 if (it != slist.end()) 3998 3988 (time_fmt_sec = ((*it).toLower() == "s")), it++; 3999 3989 if (it != slist.end()) 4000 time = decodeLongLong(slist, it);3990 (time = (*it).toLongLong()), it++; 4001 3991 if (it != slist.end()) 4002 3992 (outputfile = *it), it++; 4003 3993 outputfile = (outputfile == "<EMPTY>") ? QString::null : outputfile; -
programs/mythbackend/httpstatus.cpp
27 27 #include "mythxml.h" 28 28 29 29 #include "mythcontext.h" 30 #include "decodeencode.h"31 30 #include "mythdbcon.h" 32 31 #include "compat.h" 33 32 #include "mythconfig.h" … … 345 344 isLocalstr = *(sit++); 346 345 fsID = *(sit++); 347 346 sit++; // ignore dirID 348 iTotal = decodeLongLong(strlist, sit);349 iUsed = decodeLongLong(strlist, sit);347 iTotal = (*(sit++)).toLongLong(); 348 iUsed = (*(sit++)).toLongLong(); 350 349 iAvail = iTotal - iUsed; 351 350 352 351 if (fsID == "-2") -
programs/mythbackend/backendutil.cpp
18 18 #include "mythcontext.h" 19 19 #include "mythdbcon.h" 20 20 #include "util.h" 21 #include "decodeencode.h"22 21 #include "compat.h" 23 22 24 23 static QMap<QString, int> fsID_cache; … … 135 134 strlist << localStr; 136 135 strlist << "-1"; // Ignore fsID 137 136 strlist << dirID; 138 encodeLongLong(strlist,totalKB);139 encodeLongLong(strlist,usedKB);137 strlist << QString::number(totalKB); 138 strlist << QString::number(usedKB); 140 139 141 140 foundDirs[currentDir] = true; 142 141 } … … 182 181 fsInfo.isLocal = (*(it++)).toInt(); 183 182 fsInfo.fsID = (*(it++)).toInt(); 184 183 fsInfo.dirID = (*(it++)).toInt(); 185 fsInfo.totalSpaceKB = decodeLongLong(strlist, it);186 fsInfo.usedSpaceKB = decodeLongLong(strlist, it);184 fsInfo.totalSpaceKB = (*(it++)).toLongLong(); 185 fsInfo.usedSpaceKB = (*(it++)).toLongLong(); 187 186 fsInfo.freeSpaceKB = fsInfo.totalSpaceKB - fsInfo.usedSpaceKB; 188 187 fsInfos.push_back(fsInfo); 189 188 } … … 232 231 strlist << QString::number(it1->isLocal); 233 232 strlist << QString::number(it1->fsID); 234 233 strlist << QString::number(it1->dirID); 235 encodeLongLong(strlist,it1->totalSpaceKB);236 encodeLongLong(strlist,it1->usedSpaceKB);234 strlist << QString::number(it1->totalSpaceKB); 235 strlist << QString::number(it1->usedSpaceKB); 237 236 238 237 totalKB += it1->totalSpaceKB; 239 238 usedKB += it1->usedSpaceKB; … … 246 245 strlist << "0"; 247 246 strlist << "-2"; 248 247 strlist << "-2"; 249 encodeLongLong(strlist,totalKB);250 encodeLongLong(strlist,usedKB);248 strlist << QString::number(totalKB); 249 strlist << QString::number(usedKB); 251 250 } 252 251 } 253 252 … … 270 269 fsInfo.fsID = -1; 271 270 it++; 272 271 fsInfo.dirID = (*(it++)).toInt(); 273 fsInfo.totalSpaceKB = decodeLongLong(strlist, it);272 fsInfo.totalSpaceKB = (*(it++)).toLongLong(); 274 273 fsInfo.liveTVSpaceKB = 0; // FIXME, placeholder 275 fsInfo.usedSpaceKB = decodeLongLong(strlist, it);274 fsInfo.usedSpaceKB = (*(it++)).toLongLong(); 276 275 fsInfo.freeSpaceKB = fsInfo.totalSpaceKB - fsInfo.usedSpaceKB; 277 276 fsInfo.weight = 0; 278 277 fsInfos.push_back(fsInfo); -
programs/mythbackend/autoexpire.cpp
663 663 (!episodeParts.contains(episodeKey)) && 664 664 (found > *maxIter)) 665 665 { 666 long long spaceFreed = 667 stringToLongLong(query.value(5).toString()) >> 20; 666 long long spaceFreed = query.value(5).toLongLong() >> 20; 668 667 QString msg = 669 668 QString("Expiring %1 MBytes for %2 @ %3 => %4. Too " 670 669 "many episodes, we only want to keep %5.") … … 980 979 proginfo->seriesid = query.value(10).toString(); 981 980 proginfo->programid = query.value(11).toString(); 982 981 proginfo->recpriority = query.value(12).toInt(); 983 proginfo->filesize = stringToLongLong(query.value(15).toString());982 proginfo->filesize = query.value(15).toLongLong(); 984 983 proginfo->recgroup = query.value(16).toString(); 985 984 proginfo->storagegroup = query.value(17).toString(); 986 985 proginfo->pathname = query.value(18).toString();