Ticket #3061: patch.r12767.diff
File patch.r12767.diff, 45.2 KB (added by , 17 years ago) |
---|
-
channeleditor.cpp
54 54 " AND cardinput.cardid = capturecard.cardid"); 55 55 query.bindValue(":CHID", cid->getValue()); 56 56 57 if (query.exec() && query.isActive() && query. size() > 0)57 if (query.exec() && query.isActive() && query.next()) 58 58 { 59 query.next();60 59 return query.value(0).toString(); 61 60 } 62 61 else … … 76 75 query.bindValue(":CHID", cid->getValue()); 77 76 query.bindValue(":CARDTYPE", thecardtype); 78 77 79 if (query.exec() && query.isActive() && query. size() > 0)78 if (query.exec() && query.isActive() && query.next()) 80 79 { 81 query.next();82 80 int count = query.value(0).toInt(); 83 81 84 82 if (count > 0) … … 98 96 " AND cardinput.cardid = capturecard.cardid"); 99 97 query.bindValue(":CHID", cid->getValue()); 100 98 101 if (query.exec() && query.isActive() && query. size() > 0)99 if (query.exec() && query.isActive() && query.next()) 102 100 { 103 query.next();104 101 return query.value(0).toInt(); 105 102 } else 106 103 return 0; … … 141 138 MSqlQuery query(MSqlQuery::InitCon()); 142 139 query.prepare(querystr); 143 140 144 if (query.exec() && query.isActive() && query.size() > 0)141 if (query.exec()) 145 142 { 146 143 while(query.next()) 147 144 { … … 198 195 MSqlQuery query(MSqlQuery::InitCon()); 199 196 query.prepare("SELECT name, sourceid FROM videosource"); 200 197 201 if (query.exec() && query.isActive() && query.size() > 0)198 if (query.exec()) 202 199 { 203 200 while(query.next()) 204 201 { -
sr_items.cpp
224 224 query.prepare("SELECT cardinputid,cardid,inputname,displayname " 225 225 "FROM cardinput ORDER BY cardinputid"); 226 226 227 if (query.exec() && query.isActive() && query.size() > 0)227 if (query.exec()) 228 228 { 229 229 while (query.next()) 230 230 { -
jobqueue.cpp
533 533 } 534 534 else 535 535 { 536 if ( (query.size() > 0) &&query.next())536 if (query.next()) 537 537 { 538 538 tmpStatus = query.value(0).toInt(); 539 539 jobID = query.value(1).toInt(); … … 633 633 } 634 634 else 635 635 { 636 if ( (query.size() > 0) &&query.next())636 if (query.next()) 637 637 return query.value(0).toInt(); 638 638 } 639 639 … … 659 659 } 660 660 else 661 661 { 662 if ( (query.size() > 0) &&query.next())662 if (query.next()) 663 663 { 664 664 jobType = query.value(0).toInt(); 665 665 chanid = query.value(1).toString(); … … 779 779 return false; 780 780 } 781 781 782 if ( query.size() == 0)782 if (!query.next()) 783 783 { 784 784 jobsAreRunning = false; 785 785 break; … … 1297 1297 1298 1298 if (query.isActive()) 1299 1299 { 1300 if ( (query.size() > 0) &&query.next())1300 if (query.next()) 1301 1301 return (enum JobCmds)query.value(0).toInt(); 1302 1302 } 1303 1303 else … … 1343 1343 1344 1344 if (query.isActive()) 1345 1345 { 1346 if ( (query.size() > 0) &&query.next())1346 if (query.next()) 1347 1347 return (enum JobFlags)query.value(0).toInt(); 1348 1348 } 1349 1349 else … … 1366 1366 1367 1367 if (query.isActive()) 1368 1368 { 1369 if ( (query.size() > 0) &&query.next())1369 if (query.next()) 1370 1370 return (enum JobStatus)query.value(0).toInt(); 1371 1371 } 1372 1372 else … … 1392 1392 1393 1393 if (query.isActive()) 1394 1394 { 1395 if (query. size() > 0 && query.next())1395 if (query.next()) 1396 1396 return (enum JobStatus)query.value(0).toInt(); 1397 1397 } 1398 1398 else … … 1772 1772 query.prepare("SELECT name FROM recordingprofiles WHERE id = :ID;"); 1773 1773 query.bindValue(":ID", transcoder); 1774 1774 query.exec(); 1775 if (query.isActive() && query. size() > 0 && query.next())1775 if (query.isActive() && query.next()) 1776 1776 { 1777 1777 transcoderName = query.value(0).toString(); 1778 1778 } -
proglist.cpp
973 973 query.prepare("SELECT genre FROM programgenres GROUP BY genre;"); 974 974 query.exec(); 975 975 976 if (query.isActive() && query.size())976 if (query.isActive()) 977 977 { 978 978 while (query.next()) 979 979 { … … 1246 1246 query.prepare("SELECT category FROM program GROUP BY category;"); 1247 1247 query.exec(); 1248 1248 1249 if (query.isActive() && query.size())1249 if (query.isActive()) 1250 1250 { 1251 1251 while (query.next()) 1252 1252 { … … 1270 1270 query.bindValue(":SEARCHTYPE", searchtype); 1271 1271 query.exec(); 1272 1272 1273 if (query.isActive() && query.size())1273 if (query.isActive()) 1274 1274 { 1275 1275 while (query.next()) 1276 1276 { … … 1371 1371 query.bindValue(":RECORDID", view); 1372 1372 query.exec(); 1373 1373 1374 if (query.isActive() && query.size())1374 if (query.isActive()) 1375 1375 { 1376 1376 if (query.next()) 1377 1377 { -
dbcheck.cpp
1484 1484 " AND c.profile = p.id" 1485 1485 " AND r.profile = p.name" 1486 1486 ";"); 1487 if (recordids.exec() && recordids.isActive() && recordids.size() > 0)1487 if (recordids.exec() && recordids.isActive() ) 1488 1488 { 1489 1489 MSqlQuery update(MSqlQuery::InitCon()); 1490 1490 while (recordids.next()) … … 1623 1623 if (!recordids.exec()) 1624 1624 return false; 1625 1625 1626 if (recordids.isActive() && recordids.size() > 0)1626 if (recordids.isActive()) 1627 1627 { 1628 1628 MSqlQuery update(MSqlQuery::InitCon()); 1629 1629 while (recordids.next()) … … 2070 2070 MSqlQuery query(MSqlQuery::InitCon()); 2071 2071 query.prepare("SELECT chanid, starttime, cutlist FROM recorded" 2072 2072 " WHERE LENGTH(cutlist) > 1;"); 2073 if (query.exec() && query.isActive() && query.size() > 0)2073 if (query.exec() && query.isActive()) 2074 2074 { 2075 2075 MSqlQuery insert(MSqlQuery::InitCon()); 2076 2076 while (query.next()) … … 2526 2526 MSqlQuery query(MSqlQuery::InitCon()); 2527 2527 query.prepare("SELECT DISTINCT chanid, starttime FROM recordedmarkup " 2528 2528 "WHERE type = 1;"); 2529 if (query.exec() && query.isActive() && query.size() > 0)2529 if (query.exec() && query.isActive()) 2530 2530 { 2531 2531 MSqlQuery fixup(MSqlQuery::InitCon()); 2532 2532 while (query.next()) … … 2584 2584 2585 2585 query.prepare("SELECT data, hostname FROM settings " 2586 2586 "WHERE value = 'DisplayGroupDefaultView'"); 2587 if (query.exec() && query.isActive() && query.size() > 0)2587 if (query.exec() && query.isActive()) 2588 2588 { 2589 2589 MSqlQuery fixup(MSqlQuery::InitCon()); 2590 2590 … … 2926 2926 query.prepare("SHOW TABLES;"); 2927 2927 2928 2928 // check for > 1 table here since the schemalock table should exist 2929 if (query.exec() && query.isActive() && query. size() > 1)2929 if (query.exec() && query.isActive() && query.next() && query.next()) 2930 2930 { 2931 int qsize = 2; 2932 while(query.next()) 2933 qsize++; 2931 2934 QString msg = QString( 2932 2935 "Told to create a NEW database schema, but the database\n" 2933 2936 "already has %1 tables.\n" 2934 2937 "If you are sure this is a good mythtv database, verify\n" 2935 2938 "that the settings table has the DBSchemaVer variable.\n") 2936 .arg(q uery.size()- 1);2939 .arg(qsize - 1); 2937 2940 VERBOSE(VB_IMPORTANT, msg); 2938 2941 return false; 2939 2942 } -
livetvchain.cpp
200 200 "WHERE chainid = :CHAINID ORDER BY chainpos;"); 201 201 query.bindValue(":CHAINID", m_id); 202 202 203 if (query.exec() && query.isActive() && query.size() > 0)203 if (query.exec()) 204 204 { 205 205 while (query.next()) 206 206 { -
siscan.cpp
238 238 return false; 239 239 } 240 240 241 if ( query.size() <= 0)241 if (!query.next()) 242 242 { 243 243 VERBOSE(VB_SIPARSER, LOC + "Unable to find any transports for " + 244 244 QString("sourceid %1").arg(sourceID)); … … 246 246 return false; 247 247 } 248 248 249 while (query.next())249 do 250 250 { 251 251 int sourceid = query.value(0).toInt(); 252 252 int mplexid = query.value(1).toInt(); … … 260 260 261 261 TransportScanItem item(sourceid, std, fn, mplexid, signalTimeout); 262 262 scanTransports += item; 263 } 263 } while(query.next()); 264 264 265 265 waitingForTables = false; 266 266 transportsScanned = 0; … … 957 957 return false; 958 958 } 959 959 960 if ( query.size() <= 0)960 if (!query.next()) 961 961 { 962 962 VERBOSE(VB_SIPARSER, LOC + "Unable to find transport to scan."); 963 963 return false; 964 964 } 965 965 966 while (query.next())966 do 967 967 { 968 968 int sourceid = query.value(0).toInt(); 969 969 int mplexid = query.value(1).toInt(); … … 977 977 978 978 TransportScanItem item(sourceid, std, fn, mplexid, signalTimeout); 979 979 scanTransports += item; 980 } 980 } while(query.next()); 981 981 982 982 timer.start(); 983 983 waitingForTables = false; -
channelbase.cpp
357 357 return -1; 358 358 } 359 359 360 if ( query.size() <= 0)360 if (!query.next()) 361 361 return -1; 362 362 363 query.next();364 363 return query.value(0).toInt(); 365 364 } 366 365 … … 394 393 MythContext::DBError("InitializeInputs", query); 395 394 return false; 396 395 } 397 else if (!query. size())396 else if (!query.next()) 398 397 { 399 398 VERBOSE(VB_IMPORTANT, LOC_ERR + "InitializeInputs(): " 400 399 "\n\t\t\tCould not get inputs for the capturecard." … … 405 404 406 405 allchannels.clear(); 407 406 QString order = gContext->GetSetting("ChannelOrdering", "channum"); 408 while (query.next())407 do 409 408 { 410 409 // If there is a childcardid use it instead of cardid 411 410 uint inputcardid = query.value(6).toUInt(); … … 424 423 allchannels.insert(allchannels.end(), 425 424 channels.begin(), channels.end()); 426 425 } 426 while (query.next()); 427 427 428 ChannelUtil::SortChannels(allchannels, order); 428 429 ChannelUtil::EliminateDuplicateChanNum(allchannels); 429 430 … … 527 528 { 528 529 MythContext::DBError("checkchannel", query); 529 530 } 530 else if (query. size() > 0)531 else if (query.next()) 531 532 { 532 533 return true; 533 534 } … … 554 555 { 555 556 MythContext::DBError("checkchannel", query); 556 557 } 557 else if (query. size() > 0)558 else if (query.next()) 558 559 { 559 query.next();560 560 QString test = query.value(1).toString(); 561 561 if (test != QString::null) 562 562 inputName = QString::fromUtf8(test); … … 574 574 575 575 query.prepare("SELECT NULL FROM channel"); 576 576 577 if (query.exec() && query.size() == 0)577 if (query.exec() && !query.next()) 578 578 ret = true; 579 579 580 580 return ret; -
datadirect.cpp
683 683 if (!dd_station_info.exec()) 684 684 return false; 685 685 686 if ( dd_station_info.size() == 0)686 if (!dd_station_info.next()) 687 687 return true; 688 688 689 689 MSqlQuery chan_update_q(MSqlQuery::DDCon()); … … 695 695 " atsc_minor_chan = :MINORCHAN " 696 696 "WHERE xmltvid = :STATIONID AND sourceid = :SOURCEID"); 697 697 698 while (dd_station_info.next())698 do 699 699 { 700 700 uint freqid = dd_station_info.value(3).toUInt(); 701 701 QString chan_major = dd_station_info.value(4).toString(); … … 719 719 chan_update_q.lastQuery()); 720 720 } 721 721 } 722 while (dd_station_info.next()); 722 723 723 724 return true; 724 725 } -
channelutil.cpp
511 511 QString("GetBetterMplexID(mplexId %1, tId %2, netId %3)") 512 512 .arg(current_mplexid).arg(transport_id).arg(network_id)); 513 513 514 int q_networkid = 0, q_transportid = 0 ;514 int q_networkid = 0, q_transportid = 0, qsize = 0; 515 515 MSqlQuery query(MSqlQuery::InitCon()); 516 516 517 517 query.prepare(QString("SELECT networkid, transportid " … … 520 520 521 521 if (!query.exec() || !query.isActive()) 522 522 MythContext::DBError("Getting mplexid global search", query); 523 else if (query. size())523 else if (query.next()) 524 524 { 525 query.next();526 525 q_networkid = query.value(0).toInt(); 527 526 q_transportid = query.value(1).toInt(); 527 qsize = 1; 528 528 } 529 529 530 530 // Got a match, return it. … … 539 539 // Not in DB at all, insert it 540 540 if (!q_networkid && !q_transportid) 541 541 { 542 int qsize = query.size(); 542 while(query.next()) 543 qsize++; 544 543 545 query.prepare(QString("UPDATE dtv_multiplex " 544 546 "SET networkid = %1, transportid = %2 " 545 547 "WHERE mplexid = %3") … … 580 582 if (!query.exec() || !query.isActive()) 581 583 MythContext::DBError("Finding matching mplexid", query); 582 584 583 if (query.size() == 1) 585 qsize = 0; 586 if (query.next()) 584 587 { 585 VERBOSE(VB_SIPARSER, QString( 588 qsize = 1; 589 if(!query.next()) 590 { 591 VERBOSE(VB_SIPARSER, QString( 586 592 "GetBetterMplexID(): query#%1 qsize(%2) " 587 593 "Returning %3") 588 .arg(i).arg(query.size()).arg(current_mplexid)); 589 query.next(); 590 return query.value(0).toInt(); 594 .arg(i).arg(qsize).arg(current_mplexid)); 595 596 return query.value(0).toInt(); 597 } 591 598 } 592 599 593 if (q uery.size() >1)600 if (qsize == 1) 594 601 { 595 query.next();596 602 int ret = (i==0) ? current_mplexid : query.value(0).toInt(); 603 while (query.next()) 604 qsize++; 597 605 VERBOSE(VB_SIPARSER, QString( 598 599 600 .arg(i).arg(q uery.size()).arg(ret));606 "GetBetterMplexID(): query#%1 qsize(%2) " 607 "Returning %3") 608 .arg(i).arg(qsize).arg(ret)); 601 609 return ret; 602 610 } 603 611 } … … 655 663 MythContext::DBError("Selecting channel/dtv_multiplex 1", query); 656 664 return QString::null; 657 665 } 658 if (!query. size())666 if (!query.next()) 659 667 return QString::null; 660 668 661 query.next();662 669 return query.value(0).toString(); 663 670 } 664 671 … … 691 698 return -1; 692 699 } 693 700 694 if (query. size() > 0)701 if (query.next()) 695 702 { 696 query.next();697 703 return query.value(0).toInt(); 698 704 } 699 705 return -1; … … 859 865 "FROM dtv_multiplex " 860 866 "WHERE mplexid = :MPLEXID"); 861 867 query.bindValue(":MPLEXID", mplexid); 862 if (!query.exec() || !query.isActive() || !query. size())868 if (!query.exec() || !query.isActive() || !query.next()) 863 869 { 864 870 MythContext::DBError("Selecting channel/dtv_multiplex 2", query); 865 871 return -1; 866 872 } 867 if (!query.next())868 return -1;869 873 870 874 int source_id = query.value(0).toInt(); 871 875 … … 973 977 974 978 if (!query.exec() || !query.isActive()) 975 979 MythContext::DBError("is_chan_id_available", query); 976 else if ( query.size() == 0)980 else if (!query.next()) 977 981 return true; 978 982 979 983 return false; … … 1200 1204 return false; 1201 1205 } 1202 1206 1203 if (query. size() > 0)1207 if (query.next()) 1204 1208 { 1205 query.next();1206 1209 return query.value(0).toInt(); 1207 1210 } 1208 1211 return -1; -
programdata.cpp
37 37 query.prepare("SELECT tmoffset FROM channel where chanid = :CHANID ;"); 38 38 query.bindValue(":CHANID", chanid); 39 39 query.exec(); 40 if (!query.isActive() || query.size() != 1)40 if (!query.isActive() || !query.next()) 41 41 { 42 42 MythContext::DBError("clearDataByChannel", query); 43 43 return; 44 44 } 45 query.next();46 45 secs = query.value(0).toInt(); 47 46 48 47 secs *= 60; … … 92 91 if (!query.exec()) 93 92 MythContext::DBError("Selecting channels per source", query); 94 93 95 if (query.isActive() && query.size() > 0)94 if (query.isActive() ) 96 95 { 97 96 while (query.next()) 98 97 { … … 159 158 findq.bindValue(":FINDONE", kFindOneRecord); 160 159 findq.exec(); 161 160 162 if (findq.isActive() && findq.size() > 0)161 if (findq.isActive() ) 163 162 { 164 163 while (findq.next()) 165 164 { … … 281 280 282 281 chanQuery.exec(); 283 282 284 if (!chanQuery.isActive() || chanQuery.size() <= 0)283 if (!chanQuery.isActive() || !chanQuery.next()) 285 284 { 286 285 cerr << "Unknown xmltv channel identifier: " << mapiter.key() 287 286 << endl << "Skipping channel.\n"; 288 287 continue; 289 288 } 290 289 291 while (chanQuery.next())290 do 292 291 { 293 292 chanid = chanQuery.value(0).toInt(); 294 293 … … 351 350 query.bindValue(":PROGRAMID", (*i).programid); 352 351 query.exec(); 353 352 354 if (query.isActive() && query. size() > 0)353 if (query.isActive() && query.next()) 355 354 { 356 355 unchanged++; 357 356 continue; … … 365 364 query.bindValue(":END", (*i).end); 366 365 query.exec(); 367 366 368 if (query.isActive() && query. size() > 0)367 if (query.isActive() && query.next()) 369 368 { 370 369 if (!quiet) 371 370 { 372 while (query.next())371 do 373 372 { 374 373 cerr << "removing existing program: " 375 374 << query.value(1).toDateTime().toString(Qt::ISODate) << " - " … … 377 376 << (*i).channel.local8Bit() << " " 378 377 << QString::fromUtf8(query.value(0).toString()).local8Bit() << endl; 379 378 } 379 while (query.next()); 380 380 381 381 cerr << "inserting new program : " 382 382 << (*i).start.toString(Qt::ISODate) << " - " … … 482 482 MythContext::DBError("person lookup", query); 483 483 484 484 int personid = -1; 485 if (query.isActive() && query. size() > 0)485 if (query.isActive() && query.next()) 486 486 { 487 query.next();488 487 personid = query.value(0).toInt(); 489 488 } 490 489 … … 502 501 if (!query.exec()) 503 502 MythContext::DBError("person lookup", query); 504 503 505 if (query.isActive() && query. size() > 0)504 if (query.isActive() && query.next()) 506 505 { 507 query.next();508 506 personid = query.value(0).toInt(); 509 507 } 510 508 } … … 542 540 } 543 541 } 544 542 } 543 while(chanQuery.next()); 545 544 } 545 546 546 if (!quiet) 547 547 { 548 548 cerr << "Updated programs: " << updated -
tv_play.cpp
809 809 "hostname = :HOSTNAME ;"); 810 810 query.bindValue(":HOSTNAME", gContext->GetHostName()); 811 811 812 if (query.exec() && query. isActive() && query.size() > 0)812 if (query.exec() && query.next()) 813 813 { 814 query.next();815 816 814 QKeySequence keyseq(query.value(0).toString()); 817 815 818 816 int keynum = keyseq[0]; … … 4388 4386 query.prepare("SELECT channum FROM channel " 4389 4387 "WHERE chanid = :CHANID"); 4390 4388 query.bindValue(":CHANID", chanid); 4391 if (query.exec() && query. isActive() && query.size() > 0 && query.next())4389 if (query.exec() && query.next()) 4392 4390 channum = query.value(0).toString(); 4393 4391 else 4394 4392 channum = QString::number(chanid); … … 4707 4705 " cardid = :CARDID"); 4708 4706 query.bindValue(":CARDID", cardid); 4709 4707 query.bindValue(":INPUTNAME", inputname); 4710 if (query.exec() && query. isActive() && query.next())4708 if (query.exec() && query.next()) 4711 4709 displayName = query.value(0).toString(); 4712 4710 4713 4711 // If a display name doesn't exist use cardid and inputname -
dvbchannel.cpp
771 771 return -1; 772 772 } 773 773 774 if ( query.size() <= 0)774 if (!query.next()) 775 775 return -1; 776 776 777 query.next();778 777 return query.value(0).toInt(); 779 778 } 780 779 -
cardutil.cpp
34 34 query.bindValue(":CARDTYPE", strType); 35 35 query.bindValue(":HOSTNAME", gContext->GetHostName()); 36 36 37 if (query.exec() && query.isActive() && query. size() > 0)37 if (query.exec() && query.isActive() && query.next()) 38 38 { 39 query.next();40 39 int count = query.value(0).toInt(); 41 40 42 41 if (count > 0) -
storagegroup.cpp
49 49 50 50 if (!query.exec() || !query.isActive()) 51 51 MythContext::DBError("StorageGroup::StorageGroup()", query); 52 else if ( query.size() < 1)52 else if (!query.next() ) 53 53 { 54 54 if (group != "Default") 55 55 { … … 71 71 } 72 72 else 73 73 { 74 while(query.next())74 do 75 75 { 76 76 m_dirname = query.value(0).toString(); 77 77 m_dirname.replace(QRegExp("^\\s*"), ""); … … 79 79 if (m_dirname.right(1) == "/") 80 80 m_dirname.remove(m_dirname.length() - 1, 1); 81 81 m_dirlist << m_dirname; 82 } 82 } while(query.next()); 83 83 } 84 84 85 85 if (!m_dirlist.size()) -
videosource.cpp
87 87 query.prepare(querystr); 88 88 query.bindValue(":HOSTNAME", gContext->GetHostName()); 89 89 90 if (!query.exec() || !query.isActive() || query.size() <= 0)90 if (!query.exec() || !query.isActive() ) 91 91 return; 92 92 93 93 uint sel = 0, cnt = 0; … … 98 98 99 99 sel = (query.value(1).toUInt() == initial_sourceid) ? cnt : sel; 100 100 } 101 if(cnt==0) 102 return; 101 103 102 104 if (initial_sourceid) 103 105 { … … 581 583 query.bindValue(":SOURCEID", sourceID); 582 584 query.bindValue(":CARDTYPE", thecardtype); 583 585 584 if (query.exec() && query.isActive() && query. size() > 0)586 if (query.exec() && query.isActive() && query.next()) 585 587 { 586 query.next();587 588 int count = query.value(0).toInt(); 588 589 589 590 if (count > 0) … … 598 599 MSqlQuery result(MSqlQuery::InitCon()); 599 600 result.prepare("SELECT name, sourceid FROM videosource;"); 600 601 601 if (result.exec() && result.isActive() && result.size() > 0)602 if (result.exec() && result.isActive()) 602 603 { 603 604 while (result.next()) 604 605 { … … 1425 1426 MythContext::DBError("CaptureCard::fillSelections", query); 1426 1427 return; 1427 1428 } 1428 if (query.size() == 0)1429 return;1430 1429 1431 1430 while (query.next()) 1432 1431 { … … 2314 2313 " parentid = '0'"); 2315 2314 query.bindValue(":HOSTNAME", gContext->GetHostName()); 2316 2315 2317 if (!query.exec() || !query.isActive() || !query.size())2316 if (!query.exec() || !query.isActive()) 2318 2317 return; 2319 2318 2320 2319 uint j = 0; -
channelsettings.cpp
415 415 MythContext::DBError("sourceChanged -- supports eit", query); 416 416 else 417 417 { 418 supports_eit = (query. size()) ? false : true;419 while (query.next())418 supports_eit = (query.next()) ? false : true; 419 do 420 420 { 421 421 supports_eit |= CardUtil::IsEITCapable( 422 422 query.value(0).toString().upper()); 423 423 } 424 while (query.next()); 424 425 425 426 query.prepare("SELECT xmltvgrabber " 426 427 "FROM videosource " … … 431 432 MythContext::DBError("sourceChanged -- eit only", query); 432 433 else 433 434 { 434 uses_eit_only = (query. size()) ? true : false;435 while (query.next())435 uses_eit_only = (query.next()) ? true : false; 436 do 436 437 { 437 438 uses_eit_only &= (query.value(0).toString() == "eitonly"); 438 439 } 440 while (query.next()); 439 441 } 440 442 } 441 443 -
videoout_xv.cpp
7 7 #include <ctime> 8 8 #include <cerrno> 9 9 10 #include < malloc.h>10 #include <stdlib.h> 11 11 #include <fcntl.h> 12 12 #include <unistd.h> 13 13 #include <sys/time.h> -
profilegroup.cpp
74 74 75 75 result.prepare("SELECT DISTINCT cardtype FROM capturecard;"); 76 76 77 if (result.exec() && result.isActive() && result.size() > 0)77 if (result.exec() && result.isActive() ) 78 78 { 79 79 while (result.next()) 80 80 { … … 85 85 result.prepare("SELECT name,id,hostname,is_default,cardtype " 86 86 "FROM profilegroups;"); 87 87 88 if (result.exec() && result.isActive() && result.size() > 0)88 if (result.exec() && result.isActive()) 89 89 while (result.next()) 90 90 { 91 91 // Only show default profiles that match installed cards … … 118 118 .arg(group); 119 119 result.prepare(querystr); 120 120 121 if (result.exec() && result.isActive() && result. size() > 0)121 if (result.exec() && result.isActive() && result.next()) 122 122 { 123 result.next();124 123 return QString::fromUtf8(result.value(0).toString()); 125 124 } 126 125 … … 135 134 .arg(getName()).arg(host->getValue()); 136 135 result.prepare(querystr); 137 136 138 if (result.exec() && result.isActive() && result. size() > 0)137 if (result.exec() && result.isActive() && result.next()) 139 138 return false; 140 139 return true; 141 140 } … … 148 147 149 148 result.prepare("SELECT DISTINCT hostname from capturecard"); 150 149 151 if (result.exec() && result.isActive() && result.size() > 0)150 if (result.exec() && result.isActive() ) 152 151 { 153 152 while (result.next()) 154 153 hostnames->append(result.value(0).toString()); … … 193 192 "profilegroup = %1").arg(profileID); 194 193 result.prepare(querystr); 195 194 196 if (result.exec() && result.isActive() && result.size() > 0)195 if (result.exec() && result.isActive()) 197 196 { 198 197 while (result.next()) 199 198 { … … 287 286 "id = %1 AND is_default = 0;").arg(id); 288 287 result.prepare(querystr); 289 288 290 if (result.exec() && result.isActive() && result. size() > 0)289 if (result.exec() && result.isActive() && result.next()) 291 290 { 292 result.next();293 291 QString message = QObject::tr("Delete profile group:") + 294 292 QString("\n'%1'?").arg(ProfileGroup::getName(id)); 295 293 -
tv_rec.cpp
1570 1570 { 1571 1571 MythContext::DBError("getstartchan3", query); 1572 1572 } 1573 else if (query. size() > 0)1573 else if (query.next()) 1574 1574 { 1575 query.next();1576 1577 1575 QString test = query.value(0).toString(); 1578 1576 if (test != QString::null) 1579 1577 { … … 1954 1952 "FROM channel " 1955 1953 "WHERE channel.chanid = :CHANID"); 1956 1954 query.bindValue(":CHANID", chanid); 1957 if (!query.exec() || !query.isActive() || query.size() == 0)1955 if (!query.exec() || !query.isActive() || !query.next() ) 1958 1956 { 1959 1957 MythContext::DBError("ShouldSwitchToAnotherCard", query); 1960 1958 return false; 1961 1959 } 1962 1960 1963 query.next();1964 1961 QString channelname = query.value(0).toString(); 1965 1962 QString callsign = query.value(1).toString(); 1966 1963 … … 1982 1979 { 1983 1980 MythContext::DBError("ShouldSwitchToAnotherCard", query); 1984 1981 } 1985 else if (query. size() > 0)1982 else if (query.next()) 1986 1983 { 1987 1984 msg = "Found channel (%1) on current card(%2)."; 1988 1985 VERBOSE(VB_RECORD, LOC + msg.arg(channelname).arg(cardid)); … … 2115 2112 { 2116 2113 MythContext::DBError("checkchannel -- locate channum", query); 2117 2114 } 2118 else if (query.size())2115 else 2119 2116 { 2120 2117 while (query.next()) 2121 2118 { … … 2639 2636 { 2640 2637 MythContext::DBError("togglechannelfavorite", query); 2641 2638 } 2642 else if (query. size() > 0)2639 else if (query.next()) 2643 2640 { 2644 2641 // We have a favorites record...Remove it to toggle... 2645 query.next();2646 2642 QString favid = query.value(0).toString(); 2647 2643 query.prepare( 2648 2644 QString("DELETE FROM favorites " -
programinfo.cpp
576 576 query.prepare("SELECT icon FROM channel WHERE chanid = :CHANID ;"); 577 577 query.bindValue(":CHANID", chanid); 578 578 579 if (query.exec() && query.isActive() && query.size() > 0) 580 if (query.next()) 579 if (query.exec() && query.isActive() && query.next()) 581 580 progMap["iconpath"] = query.value(0).toString(); 582 581 583 582 progMap["RECSTATUS"] = RecStatusText(); … … 802 801 "WHERE basename = :BASENAME;"); 803 802 query.bindValue(":BASENAME", filename); 804 803 805 if (query.exec() && query.isActive() && query. size() > 0)804 if (query.exec() && query.isActive() && query.next()) 806 805 { 807 query.next();808 809 806 return GetProgramFromRecorded(query.value(0).toString(), 810 807 query.value(1).toDateTime()); 811 808 } … … 847 844 query.bindValue(":CHANNEL", channel); 848 845 query.bindValue(":STARTTIME", starttime); 849 846 850 if (query.exec() && query.isActive() && query. size() > 0)847 if (query.exec() && query.isActive() && query.next()) 851 848 { 852 query.next();853 854 849 ProgramInfo *proginfo = new ProgramInfo; 855 850 proginfo->chanid = query.value(0).toString(); 856 851 proginfo->startts = query.value(23).toDateTime(); … … 1025 1020 query.prepare("SELECT recpriority FROM channel WHERE chanid = :CHANID ;"); 1026 1021 query.bindValue(":CHANID", channel); 1027 1022 1028 if (query.exec() && query.isActive() && query. size() > 0)1023 if (query.exec() && query.isActive() && query.next()) 1029 1024 { 1030 query.next();1031 1025 return query.value(0).toInt(); 1032 1026 } 1033 1027 … … 1485 1479 1486 1480 if (!query.exec() || !query.isActive()) 1487 1481 MythContext::DBError("GetRecordBasename", query); 1488 else if ( query.size() < 1)1482 else if (!query.next()) 1489 1483 VERBOSE(VB_IMPORTANT, QString("GetRecordBasename found no entry")); 1490 1484 else 1491 1485 { 1492 query.next();1493 1486 retval = query.value(0).toString(); 1494 1487 } 1495 1488 } … … 1663 1656 query.bindValue(":CHANID", pg->chanid); 1664 1657 query.bindValue(":STARTS", pg->recstartts); 1665 1658 1666 if (!query.exec() || query. size())1659 if (!query.exec() || query.next()) 1667 1660 { 1668 1661 if (!query.isActive()) 1669 1662 MythContext::DBError("insert_program -- select", query); … … 1838 1831 query.bindValue(":CHANID", chanid); 1839 1832 query.bindValue(":STARTTIME", recstartts); 1840 1833 1841 if (query.exec() && query.isActive() && query. size() > 0)1834 if (query.exec() && query.isActive() && query.next()) 1842 1835 { 1843 query.next();1844 1836 filesize = stringToLongLong(query.value(0).toString()); 1845 1837 } 1846 1838 else … … 1924 1916 " WHERE serialid = ? "); 1925 1917 query.addBindValue(serialid.utf8()); 1926 1918 1927 if (query.exec() && query.isActive() && query. size() > 0)1919 if (query.exec() && query.isActive() && query.next()) 1928 1920 { 1929 query.next();1930 1921 for(int i = 0; i < 4; i++) 1931 1922 fields.append(query.value(i).toString()); 1932 1923 } … … 2029 2020 query.bindValue(":CHANID", chanid); 2030 2021 query.bindValue(":STARTTIME", recstartts); 2031 2022 2032 if (query.exec() && query.isActive() && query. size() > 0)2023 if (query.exec() && query.isActive() && query.next()) 2033 2024 { 2034 query.next();2035 2025 return query.value(0).toBool(); 2036 2026 } 2037 2027 … … 2097 2087 query.bindValue(":CHANID", chanid); 2098 2088 query.bindValue(":STARTTIME", recstartts); 2099 2089 2100 if (query.exec() && query.isActive() && query. size() > 0)2090 if (query.exec() && query.isActive() && query.next()) 2101 2091 { 2102 query.next();2103 2092 return query.value(0).toBool(); 2104 2093 } 2105 2094 … … 2128 2117 query.bindValue(":ONEHOURAGO", oneHourAgo); 2129 2118 2130 2119 byWho = ""; 2131 if (query.exec() && query.isActive() && query. size() > 0)2120 if (query.exec() && query.isActive() && query.next()) 2132 2121 { 2133 2122 QString usageStr, recusage; 2134 while(query.next())2123 do 2135 2124 { 2136 2125 usageStr = QObject::tr("Unknown"); 2137 2126 recusage = query.value(1).toString(); … … 2148 2137 usageStr = QObject::tr("PIP"); 2149 2138 2150 2139 byWho += query.value(0).toString() + " (" + usageStr + ")\n"; 2151 } 2140 } 2141 while(query.next()); 2152 2142 2153 2143 return true; 2154 2144 } … … 2169 2159 query.bindValue(":CHANID", chanid); 2170 2160 query.bindValue(":STARTTIME", recstartts); 2171 2161 2172 if (query.exec() && query.isActive() && query. size() > 0)2162 if (query.exec() && query.isActive() && query.next()) 2173 2163 { 2174 query.next();2175 2164 return query.value(0).toInt(); 2176 2165 } 2177 2166 … … 2297 2286 query.bindValue(":CHANID", chanid); 2298 2287 query.bindValue(":STARTTIME", recstartts); 2299 2288 2300 if (query.exec() && query.isActive() && query. size() > 0)2289 if (query.exec() && query.isActive() && query.next()) 2301 2290 { 2302 query.next();2303 2291 return query.value(0).toInt(); 2304 2292 } 2305 2293 … … 2319 2307 query.bindValue(":CHANID", chanid); 2320 2308 query.bindValue(":STARTTIME", recstartts); 2321 2309 2322 if (query.exec() && query.isActive() && query. size() > 0)2310 if (query.exec() && query.isActive() && query.next()) 2323 2311 { 2324 query.next();2325 2312 return query.value(0).toBool(); 2326 2313 } 2327 2314 … … 2339 2326 "recordid = :RECID ;"); 2340 2327 query.bindValue(":RECID", recordid); 2341 2328 2342 if (query.exec() && query.isActive() && query. size() > 0)2329 if (query.exec() && query.isActive() && query.next()) 2343 2330 { 2344 query.next();2345 2331 return query.value(0).toInt(); 2346 2332 } 2347 2333 … … 2456 2442 if (!query.exec() || !query.isActive()) 2457 2443 MythContext::DBError("SetMarkupMap checking record table", query); 2458 2444 2459 if ( query.size() < 1 ||!query.next())2445 if (!query.next()) 2460 2446 return; 2461 2447 } 2462 2448 … … 2531 2517 } 2532 2518 query.bindValue(":TYPE", type); 2533 2519 2534 if (query.exec() && query.isActive() && query.size() > 0)2520 if (query.exec() && query.isActive()) 2535 2521 { 2536 2522 while(query.next()) 2537 2523 marks[stringToLongLong(query.value(0).toString())] = … … 2585 2571 } 2586 2572 query.bindValue(":TYPE", type); 2587 2573 2588 if (query.exec() && query.isActive() && query.size() > 0)2574 if (query.exec() && query.isActive()) 2589 2575 { 2590 2576 while (query.next()) 2591 2577 posMap[stringToLongLong(query.value(0).toString())] = … … 3473 3459 query.bindValue(":CHANID", chanid); 3474 3460 query.bindValue(":STARTTIME", startts); 3475 3461 3476 if (query.exec() && query.isActive() && query. size() > 0)3462 if (query.exec() && query.isActive() && query.next()) 3477 3463 { 3478 query.next();3479 3464 category_type = query.value(0).toString(); 3480 3465 year = query.value(1).toString(); 3481 3466 stars = query.value(2).toDouble(); … … 3583 3568 query.bindValue(":CHANID", chanid); 3584 3569 query.bindValue(":STARTTIME", startts); 3585 3570 3586 if (query.exec() && query.isActive() && query.size() > 0)3571 if (query.exec() && query.isActive()) 3587 3572 { 3588 3573 while (query.next()) 3589 3574 s += ", " + query.value(0).toString(); … … 3632 3617 query.bindValue(":CHANID", chanid); 3633 3618 query.bindValue(":STARTTIME", startts); 3634 3619 3635 if (query.exec() && query.isActive() && query.size() > 0)3620 if (query.exec() && query.isActive()) 3636 3621 { 3637 3622 QString rstr = "", plist = ""; 3638 3623 … … 3724 3709 if (!query.exec() || !query.isActive()) 3725 3710 MythContext::DBError("showDetails", query); 3726 3711 3727 if (query.isActive() && query. size() > 0)3712 if (query.isActive() && query.next()) 3728 3713 { 3729 query.next();3730 3714 if (p->recstatus == rsUnknown) 3731 3715 p->recstatus = RecStatusType(query.value(0).toInt()); 3732 3716 if (p->recstatus == rsPreviousRecording || … … 3766 3750 "WHERE recordid = :RECORDID"); 3767 3751 query.bindValue(":RECORDID", recordid); 3768 3752 3769 if (query.exec() && query.isActive() && query. size() > 0)3753 if (query.exec() && query.isActive() && query.next()) 3770 3754 { 3771 query.next();3772 3755 if (query.value(0).toDateTime().isValid()) 3773 3756 ADD_PAR(QObject::tr("Last Recorded"), 3774 3757 QObject::tr(query.value(0).toDateTime() … … 3831 3814 query.bindValue(":CHANID", chanid); 3832 3815 query.bindValue(":STARTTIME", recstartts); 3833 3816 3834 if (query.exec() && query.isActive() && query. size() > 0)3817 if (query.exec() && query.isActive() && query.next()) 3835 3818 { 3836 query.next();3837 3819 if (query.value(0).toString() > "") 3838 3820 ADD_PAR(QObject::tr("Recording Profile"), 3839 3821 QObject::tr(query.value(0).toString()), msg) … … 3872 3854 query.bindValue(":CHANID", chanid); 3873 3855 query.bindValue(":STARTTIME", recstartts); 3874 3856 3875 if (query.exec() && query.isActive() && query. size() > 0)3857 if (query.exec() && query.isActive() && query.next()) 3876 3858 { 3877 query.next();3878 3879 3859 flags |= (query.value(0).toInt() == COMM_FLAG_DONE) ? FL_COMMFLAG : 0; 3880 3860 flags |= (query.value(1).toInt() == 1) ? FL_CUTLIST : 0; 3881 3861 flags |= query.value(2).toInt() ? FL_AUTOEXP : 0; … … 3930 3910 "WHERE recgroup = :GROUP ;"); 3931 3911 query.bindValue(":GROUP", group.utf8()); 3932 3912 3933 if (query.exec() && query.isActive() && query.size() > 0)3913 if (query.exec() && query.isActive() ) 3934 3914 if (query.next()) 3935 3915 result = query.value(0).toString(); 3936 3916 } … … 3951 3931 "AND starttime = :START ;"); 3952 3932 query.bindValue(":START", recstartts); 3953 3933 query.bindValue(":CHANID", chanid); 3954 if (query.exec() && query.isActive() && query.size() > 0)3934 if (query.exec() && query.isActive()) 3955 3935 { 3956 3936 if(query.next() && recgroup != query.value(0).toString()) 3957 3937 recgroup = query.value(0).toString(); … … 4605 4585 " FROM inuseprograms WHERE lastupdatetime >= :ONEHOURAGO ;"); 4606 4586 query.bindValue(":ONEHOURAGO", oneHourAgo); 4607 4587 4608 if (query.exec() && query.isActive() && query.size() > 0)4588 if (query.exec() && query.isActive()) 4609 4589 { 4610 4590 while (query.next()) 4611 4591 { -
scheduledrecording.cpp
233 233 234 234 query.prepare(queryStr); 235 235 236 if (query.exec() && query.isActive() && query. size() > 0)236 if (query.exec() && query.isActive() && query.next() ) 237 237 { 238 query.next();239 238 chanstr = query.value(0).toString(); 240 239 chansign = query.value(1).toString(); 241 240 channame = query.value(2).toString(); … … 601 600 { 602 601 MSqlQuery result(MSqlQuery::InitCon()); 603 602 result.prepare("SELECT recordid FROM record"); 604 if (result.exec() && result.isActive() && result.size() > 0)603 if (result.exec() && result.isActive()) 605 604 { 606 605 while (result.next()) 607 606 { -
recordingprofile.cpp
1325 1325 MythContext::DBError("RecordingProfile::fillSelections 1", result); 1326 1326 return; 1327 1327 } 1328 else if (!result. size())1328 else if (!result.next()) 1329 1329 return; 1330 1330 1331 1331 if (group == RecordingProfile::TranscoderGroup && foldautodetect) … … 1334 1334 setting->addSelection(QObject::tr("Autodetect"), id); 1335 1335 } 1336 1336 1337 while (result.next())1337 do 1338 1338 { 1339 1339 QString name = result.value(0).toString(); 1340 1340 QString id = result.value(1).toString(); … … 1358 1358 1359 1359 setting->addSelection(name, id); 1360 1360 } 1361 while(result.next()); 1361 1362 } 1362 1363 1363 1364 void RecordingProfile::fillSelections(SelectManagedListItem *setting, … … 1387 1388 MythContext::DBError("RecordingProfile::fillSelections 2", result); 1388 1389 return; 1389 1390 } 1390 else if (!result. size())1391 else if (!result.next()) 1391 1392 return; 1392 1393 1393 1394 if (group == RecordingProfile::TranscoderGroup) … … 1396 1397 setting->addSelection(QObject::tr("Transcode using Autodetect"), id); 1397 1398 } 1398 1399 1399 while (result.next())1400 do 1400 1401 { 1401 1402 QString name = result.value(0).toString(); 1402 1403 QString id = result.value(1).toString(); … … 1415 1416 QString lbl = QObject::tr("Record using the \"%1\" profile").arg(name); 1416 1417 setting->addSelection(lbl, result.value(1).toString(), false); 1417 1418 } 1419 while (result.next()); 1418 1420 } 1419 1421 1420 1422 QString RecordingProfile::groupType(void) const … … 1427 1429 .arg(getProfileNum()); 1428 1430 result.prepare(querystr); 1429 1431 1430 if (result.exec() && result.isActive() && result. size() > 0)1432 if (result.exec() && result.isActive() && result.next()) 1431 1433 { 1432 result.next();1433 1434 return (result.value(0).toString()); 1434 1435 } 1435 1436 … … 1443 1444 "id = %1;").arg(id); 1444 1445 result.prepare(querystr); 1445 1446 1446 if (result.exec() && result.isActive() && result. size() > 0)1447 if (result.exec() && result.isActive() && result.next()) 1447 1448 { 1448 result.next();1449 1449 return (result.value(0).toString()); 1450 1450 } 1451 1451 -
scanwizardhelpers.cpp
172 172 "ORDER by frequency, networkid, transportid"); 173 173 query.bindValue(":SOURCEID", sourceid); 174 174 175 if (!query.exec() || !query.isActive() || query.size() <= 0)175 if (!query.exec() || !query.isActive()) 176 176 return; 177 177 178 178 while (query.next()) -
sourceutil.cpp
17 17 "WHERE sourceid = :SOURCEID"); 18 18 query.bindValue(":SOURCEID", sourceid); 19 19 20 if (query.exec() && query.isActive() && query. size() > 0)20 if (query.exec() && query.isActive() && query.next() ) 21 21 { 22 22 QMap<QString,uint> counts; 23 23 const QRegExp sepExpr("(_|-|#|\\.)"); 24 while (query.next())24 do 25 25 { 26 26 const QString channum = query.value(0).toString(); 27 27 const int where = channum.find(sepExpr); … … 29 29 counts["0"]++; 30 30 else 31 31 counts[(where < 0) ? "" : QString(channum.at(where))]++; 32 } 32 } while(query.next()); 33 33 QString sep = "_"; 34 34 uint max = counts["_"]; 35 35 static char *spacers[6] = { "", "-", "#", ".", "0", NULL };