Changeset 14377
- Timestamp:
- Dec 12, 2014, 11:05:10 PM (8 years ago)
- Location:
- trunk/qt
- Files:
-
- 34 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/qt/about.cc
r14376 r14377 28 28 #include "license.h" 29 29 30 AboutDialog ::AboutDialog (QWidget * parent):30 AboutDialog::AboutDialog (QWidget * parent): 31 31 QDialog (parent, Qt::Dialog), 32 32 myLicenseDialog (new LicenseDialog (this)) … … 84 84 85 85 void 86 AboutDialog ::showCredits ()86 AboutDialog::showCredits () 87 87 { 88 88 QMessageBox::about ( -
trunk/qt/add-data.cc
r14359 r14377 18 18 19 19 int 20 AddData ::set (const QString& key)20 AddData::set (const QString& key) 21 21 { 22 22 if (Utils::isMagnetLink (key)) … … 65 65 66 66 QByteArray 67 AddData ::toBase64 () const67 AddData::toBase64 () const 68 68 { 69 69 QByteArray ret; … … 81 81 82 82 QString 83 AddData ::readableName () const83 AddData::readableName () const 84 84 { 85 85 QString ret; -
trunk/qt/app.cc
r14376 r14377 83 83 } 84 84 85 MyApp ::MyApp (int& argc, char ** argv):85 MyApp::MyApp (int& argc, char ** argv): 86 86 QApplication (argc, argv), 87 87 myPrefs(nullptr), … … 309 309 310 310 void 311 MyApp ::onTorrentsAdded (QSet<int> torrents)311 MyApp::onTorrentsAdded (QSet<int> torrents) 312 312 { 313 313 if (!myPrefs->getBool (Prefs::SHOW_NOTIFICATION_ON_ADD)) … … 333 333 334 334 void 335 MyApp ::onTorrentCompleted (int id)335 MyApp::onTorrentCompleted (int id) 336 336 { 337 337 Torrent * tor = myModel->getTorrentFromId (id); … … 356 356 357 357 void 358 MyApp ::onNewTorrentChanged (int id)358 MyApp::onNewTorrentChanged (int id) 359 359 { 360 360 Torrent * tor = myModel->getTorrentFromId (id); … … 378 378 379 379 void 380 MyApp ::consentGiven ()380 MyApp::consentGiven () 381 381 { 382 382 myPrefs->set<bool> (Prefs::USER_HAS_GIVEN_INFORMED_CONSENT, true); 383 383 } 384 384 385 MyApp ::~MyApp ()385 MyApp::~MyApp () 386 386 { 387 387 if (myPrefs != nullptr && myWindow != nullptr) 388 388 { 389 389 const QRect mainwinRect (myWindow->geometry ()); 390 myPrefs->set (Prefs ::MAIN_WINDOW_HEIGHT, std::max (100, mainwinRect.height ()));391 myPrefs->set (Prefs ::MAIN_WINDOW_WIDTH, std::max (100, mainwinRect.width ()));392 myPrefs->set (Prefs ::MAIN_WINDOW_X, mainwinRect.x ());393 myPrefs->set (Prefs ::MAIN_WINDOW_Y, mainwinRect.y ());390 myPrefs->set (Prefs::MAIN_WINDOW_HEIGHT, std::max (100, mainwinRect.height ())); 391 myPrefs->set (Prefs::MAIN_WINDOW_WIDTH, std::max (100, mainwinRect.width ())); 392 myPrefs->set (Prefs::MAIN_WINDOW_X, mainwinRect.x ()); 393 myPrefs->set (Prefs::MAIN_WINDOW_Y, mainwinRect.y ()); 394 394 } 395 395 … … 406 406 407 407 void 408 MyApp ::refreshPref (int key)408 MyApp::refreshPref (int key) 409 409 { 410 410 switch (key) 411 411 { 412 case Prefs ::BLOCKLIST_UPDATES_ENABLED:412 case Prefs::BLOCKLIST_UPDATES_ENABLED: 413 413 maybeUpdateBlocklist (); 414 414 break; 415 415 416 case Prefs ::DIR_WATCH:417 case Prefs ::DIR_WATCH_ENABLED:416 case Prefs::DIR_WATCH: 417 case Prefs::DIR_WATCH_ENABLED: 418 418 { 419 419 const QString path (myPrefs->getString (Prefs::DIR_WATCH)); … … 429 429 430 430 void 431 MyApp ::maybeUpdateBlocklist ()432 { 433 if (!myPrefs->getBool (Prefs ::BLOCKLIST_UPDATES_ENABLED))431 MyApp::maybeUpdateBlocklist () 432 { 433 if (!myPrefs->getBool (Prefs::BLOCKLIST_UPDATES_ENABLED)) 434 434 return; 435 435 436 const QDateTime lastUpdatedAt = myPrefs->getDateTime (Prefs ::BLOCKLIST_DATE);436 const QDateTime lastUpdatedAt = myPrefs->getDateTime (Prefs::BLOCKLIST_DATE); 437 437 const QDateTime nextUpdateAt = lastUpdatedAt.addDays (7); 438 438 const QDateTime now = QDateTime::currentDateTime (); … … 441 441 { 442 442 mySession->updateBlocklist (); 443 myPrefs->set (Prefs ::BLOCKLIST_DATE, now);444 } 445 } 446 447 void 448 MyApp ::onSessionSourceChanged ()443 myPrefs->set (Prefs::BLOCKLIST_DATE, now); 444 } 445 } 446 447 void 448 MyApp::onSessionSourceChanged () 449 449 { 450 450 mySession->initTorrents (); … … 454 454 455 455 void 456 MyApp ::refreshTorrents ()456 MyApp::refreshTorrents () 457 457 { 458 458 // usually we just poll the torrents that have shown recent activity, … … 476 476 477 477 void 478 MyApp ::addTorrent (const QString& key)478 MyApp::addTorrent (const QString& key) 479 479 { 480 480 const AddData addme (key); … … 485 485 486 486 void 487 MyApp ::addTorrent (const AddData& addme)488 { 489 if (!myPrefs->getBool (Prefs ::OPTIONS_PROMPT))487 MyApp::addTorrent (const AddData& addme) 488 { 489 if (!myPrefs->getBool (Prefs::OPTIONS_PROMPT)) 490 490 { 491 491 mySession->addTorrent (addme); … … 505 505 506 506 void 507 MyApp ::raise ()508 { 509 QApplication ::alert (myWindow);507 MyApp::raise () 508 { 509 QApplication::alert (myWindow); 510 510 } 511 511 512 512 bool 513 MyApp ::notifyApp (const QString& title, const QString& body) const513 MyApp::notifyApp (const QString& title, const QString& body) const 514 514 { 515 515 const QString dbusServiceName = QString::fromUtf8 ("org.freedesktop.Notifications"); -
trunk/qt/dbus-adaptor.cc
r14225 r14377 12 12 #include "dbus-adaptor.h" 13 13 14 TrDBusAdaptor ::TrDBusAdaptor (MyApp* app):14 TrDBusAdaptor::TrDBusAdaptor (MyApp* app): 15 15 QDBusAbstractAdaptor (app), 16 16 myApp (app) … … 19 19 20 20 bool 21 TrDBusAdaptor ::PresentWindow ()21 TrDBusAdaptor::PresentWindow () 22 22 { 23 23 myApp->raise (); … … 26 26 27 27 bool 28 TrDBusAdaptor ::AddMetainfo (const QString& key)28 TrDBusAdaptor::AddMetainfo (const QString& key) 29 29 { 30 30 AddData addme (key); -
trunk/qt/details.cc
r14238 r14377 138 138 139 139 QIcon 140 Details ::getStockIcon (const QString& freedesktop_name, int fallback)140 Details::getStockIcon (const QString& freedesktop_name, int fallback) 141 141 { 142 142 QIcon icon = QIcon::fromTheme (freedesktop_name); … … 148 148 } 149 149 150 Details ::Details (Session & session,151 152 153 150 Details::Details (Session & session, 151 Prefs & prefs, 152 TorrentModel & model, 153 QWidget * parent): 154 154 QDialog (parent, Qt::Dialog), 155 155 mySession (session), … … 183 183 184 184 QList<int> initKeys; 185 initKeys << Prefs ::SHOW_TRACKER_SCRAPES186 << Prefs ::SHOW_BACKUP_TRACKERS;185 initKeys << Prefs::SHOW_TRACKER_SCRAPES 186 << Prefs::SHOW_BACKUP_TRACKERS; 187 187 foreach (int key, initKeys) 188 188 refreshPref (key); … … 196 196 } 197 197 198 Details ::~Details ()198 Details::~Details () 199 199 { 200 200 myTrackerDelegate->deleteLater (); … … 204 204 205 205 void 206 Details ::setIds (const QSet<int>& ids)206 Details::setIds (const QSet<int>& ids) 207 207 { 208 208 if (ids == myIds) … … 238 238 239 239 void 240 Details ::refreshPref (int key)240 Details::refreshPref (int key) 241 241 { 242 242 QString str; … … 244 244 switch (key) 245 245 { 246 case Prefs ::SHOW_TRACKER_SCRAPES:246 case Prefs::SHOW_TRACKER_SCRAPES: 247 247 { 248 248 QItemSelectionModel * selectionModel (myTrackerView->selectionModel ()); … … 257 257 } 258 258 259 case Prefs ::SHOW_BACKUP_TRACKERS:259 case Prefs::SHOW_BACKUP_TRACKERS: 260 260 myTrackerFilter->setShowBackupTrackers (myPrefs.getBool (key)); 261 261 break; … … 272 272 273 273 QString 274 Details ::timeToStringRounded (int seconds)274 Details::timeToStringRounded (int seconds) 275 275 { 276 276 if (seconds > 60) … … 281 281 282 282 void 283 Details ::onTimer ()283 Details::onTimer () 284 284 { 285 285 getNewData (); … … 287 287 288 288 void 289 Details ::getNewData ()289 Details::getNewData () 290 290 { 291 291 if (!myIds.empty ()) … … 306 306 307 307 void 308 Details ::onTorrentChanged ()308 Details::onTorrentChanged () 309 309 { 310 310 if (!myHavePendingRefresh) … … 349 349 350 350 void 351 Details ::refresh ()351 Details::refresh () 352 352 { 353 353 const int n = myIds.size (); … … 924 924 925 925 void 926 Details ::enableWhenChecked (QCheckBox * box, QWidget * w)926 Details::enableWhenChecked (QCheckBox * box, QWidget * w) 927 927 { 928 928 connect (box, SIGNAL (toggled (bool)), w, SLOT (setEnabled (bool))); … … 936 936 937 937 QWidget * 938 Details ::createInfoTab ()938 Details::createInfoTab () 939 939 { 940 940 HIG * hig = new HIG (this); … … 974 974 975 975 void 976 Details ::onShowTrackerScrapesToggled (bool val)976 Details::onShowTrackerScrapesToggled (bool val) 977 977 { 978 978 myPrefs.set (Prefs::SHOW_TRACKER_SCRAPES, val); … … 980 980 981 981 void 982 Details ::onShowBackupTrackersToggled (bool val)982 Details::onShowBackupTrackersToggled (bool val) 983 983 { 984 984 myPrefs.set (Prefs::SHOW_BACKUP_TRACKERS, val); … … 986 986 987 987 void 988 Details ::onHonorsSessionLimitsToggled (bool val)988 Details::onHonorsSessionLimitsToggled (bool val) 989 989 { 990 990 mySession.torrentSet (myIds, TR_KEY_honorsSessionLimits, val); … … 992 992 } 993 993 void 994 Details ::onDownloadLimitedToggled (bool val)994 Details::onDownloadLimitedToggled (bool val) 995 995 { 996 996 mySession.torrentSet (myIds, TR_KEY_downloadLimited, val); … … 998 998 } 999 999 void 1000 Details ::onSpinBoxEditingFinished ()1000 Details::onSpinBoxEditingFinished () 1001 1001 { 1002 1002 const QObject * spin = sender (); … … 1011 1011 1012 1012 void 1013 Details ::onUploadLimitedToggled (bool val)1013 Details::onUploadLimitedToggled (bool val) 1014 1014 { 1015 1015 mySession.torrentSet (myIds, TR_KEY_uploadLimited, val); … … 1018 1018 1019 1019 void 1020 Details ::onIdleModeChanged (int index)1020 Details::onIdleModeChanged (int index) 1021 1021 { 1022 1022 const int val = myIdleCombo->itemData (index).toInt (); … … 1026 1026 1027 1027 void 1028 Details ::onRatioModeChanged (int index)1028 Details::onRatioModeChanged (int index) 1029 1029 { 1030 1030 const int val = myRatioCombo->itemData (index).toInt (); … … 1033 1033 1034 1034 void 1035 Details ::onBandwidthPriorityChanged (int index)1035 Details::onBandwidthPriorityChanged (int index) 1036 1036 { 1037 1037 if (index != -1) … … 1044 1044 1045 1045 void 1046 Details ::onTrackerSelectionChanged ()1046 Details::onTrackerSelectionChanged () 1047 1047 { 1048 1048 const int selectionCount = myTrackerView->selectionModel ()->selectedRows ().size (); … … 1052 1052 1053 1053 void 1054 Details ::onAddTrackerClicked ()1054 Details::onAddTrackerClicked () 1055 1055 { 1056 1056 bool ok = false; … … 1090 1090 1091 1091 void 1092 Details ::onEditTrackerClicked ()1092 Details::onEditTrackerClicked () 1093 1093 { 1094 1094 QItemSelectionModel * selectionModel = myTrackerView->selectionModel (); … … 1126 1126 1127 1127 void 1128 Details ::onRemoveTrackerClicked ()1128 Details::onRemoveTrackerClicked () 1129 1129 { 1130 1130 // make a map of torrentIds to announce URLs to remove … … 1151 1151 1152 1152 QWidget * 1153 Details ::createOptionsTab ()1153 Details::createOptionsTab () 1154 1154 { 1155 1155 QSpinBox * s; … … 1204 1204 1205 1205 h = new QHBoxLayout (); 1206 h->setSpacing (HIG ::PAD);1206 h->setSpacing (HIG::PAD); 1207 1207 m = new QComboBox; 1208 1208 m->addItem (tr ("Use Global Settings"), TR_RATIOLIMIT_GLOBAL); … … 1219 1219 1220 1220 h = new QHBoxLayout (); 1221 h->setSpacing (HIG ::PAD);1221 h->setSpacing (HIG::PAD); 1222 1222 m = new QComboBox; 1223 1223 m->addItem (tr ("Use Global Settings"), TR_IDLELIMIT_GLOBAL); … … 1256 1256 1257 1257 QWidget * 1258 Details ::createTrackerTab ()1258 Details::createTrackerTab () 1259 1259 { 1260 1260 QCheckBox * c; … … 1339 1339 1340 1340 QWidget * 1341 Details ::createPeersTab ()1341 Details::createPeersTab () 1342 1342 { 1343 1343 QWidget * top = new QWidget; 1344 1344 QVBoxLayout * v = new QVBoxLayout (top); 1345 v->setSpacing (HIG ::PAD_BIG);1345 v->setSpacing (HIG::PAD_BIG); 1346 1346 v->setContentsMargins (HIG::PAD_BIG, HIG::PAD_BIG, HIG::PAD_BIG, HIG::PAD_BIG); 1347 1347 … … 1380 1380 1381 1381 QWidget * 1382 Details ::createFilesTab ()1382 Details::createFilesTab () 1383 1383 { 1384 1384 myFileTreeView = new FileTreeView (); … … 1400 1400 1401 1401 void 1402 Details ::onFilePriorityChanged (const QSet<int>& indices, int priority)1402 Details::onFilePriorityChanged (const QSet<int>& indices, int priority) 1403 1403 { 1404 1404 tr_quark key; … … 1424 1424 1425 1425 void 1426 Details ::onFileWantedChanged (const QSet<int>& indices, bool wanted)1426 Details::onFileWantedChanged (const QSet<int>& indices, bool wanted) 1427 1427 { 1428 1428 const tr_quark key = wanted ? TR_KEY_files_wanted : TR_KEY_files_unwanted; … … 1432 1432 1433 1433 void 1434 Details ::onPathEdited (const QString& oldpath, const QString& newname)1434 Details::onPathEdited (const QString& oldpath, const QString& newname) 1435 1435 { 1436 1436 mySession.torrentRenamePath (myIds, oldpath, newname); … … 1438 1438 1439 1439 void 1440 Details ::onOpenRequested (const QString& path)1440 Details::onOpenRequested (const QString& path) 1441 1441 { 1442 1442 if (!mySession.isLocal ()) -
trunk/qt/favicon.cc
r14225 r14377 25 25 ***/ 26 26 27 Favicons ::Favicons ()27 Favicons::Favicons () 28 28 { 29 29 myNAM = new QNetworkAccessManager (); … … 31 31 } 32 32 33 Favicons ::~Favicons ()33 Favicons::~Favicons () 34 34 { 35 35 delete myNAM; … … 41 41 42 42 QString 43 Favicons ::getCacheDir ()43 Favicons::getCacheDir () 44 44 { 45 45 const QString base = … … 54 54 55 55 void 56 Favicons ::ensureCacheDirHasBeenScanned ()56 Favicons::ensureCacheDirHasBeenScanned () 57 57 { 58 58 static bool hasBeenScanned = false; … … 77 77 78 78 QString 79 Favicons ::getHost (const QUrl& url)79 Favicons::getHost (const QUrl& url) 80 80 { 81 81 QString host = url.host (); … … 90 90 91 91 QPixmap 92 Favicons ::find (const QUrl& url)92 Favicons::find (const QUrl& url) 93 93 { 94 94 return findFromHost (getHost (url)); … … 101 101 102 102 QPixmap 103 Favicons ::findFromHost (const QString& host)103 Favicons::findFromHost (const QString& host) 104 104 { 105 105 ensureCacheDirHasBeenScanned (); … … 110 110 111 111 void 112 Favicons ::add (const QUrl& url)112 Favicons::add (const QUrl& url) 113 113 { 114 114 ensureCacheDirHasBeenScanned (); … … 133 133 134 134 void 135 Favicons ::onRequestFinished (QNetworkReply * reply)135 Favicons::onRequestFinished (QNetworkReply * reply) 136 136 { 137 137 const QString host = reply->url().host(); -
trunk/qt/file-tree.cc
r14345 r14377 45 45 46 46 const QHash<QString,int>& 47 FileTreeItem ::getMyChildRows ()47 FileTreeItem::getMyChildRows () 48 48 { 49 49 const size_t n = childCount(); … … 61 61 62 62 63 FileTreeItem ::~FileTreeItem ()63 FileTreeItem::~FileTreeItem () 64 64 { 65 65 assert(myChildren.isEmpty()); … … 76 76 77 77 void 78 FileTreeItem ::appendChild (FileTreeItem * child)78 FileTreeItem::appendChild (FileTreeItem * child) 79 79 { 80 80 const size_t n = childCount(); … … 85 85 86 86 FileTreeItem * 87 FileTreeItem ::child (const QString& filename)87 FileTreeItem::child (const QString& filename) 88 88 { 89 89 FileTreeItem * item(0); … … 100 100 101 101 int 102 FileTreeItem ::row () const102 FileTreeItem::row () const 103 103 { 104 104 int i(-1); … … 114 114 115 115 QVariant 116 FileTreeItem ::data (int column, int role) const116 FileTreeItem::data (int column, int role) const 117 117 { 118 118 QVariant value; … … 168 168 169 169 void 170 FileTreeItem ::getSubtreeWantedSize (uint64_t& have, uint64_t& total) const170 FileTreeItem::getSubtreeWantedSize (uint64_t& have, uint64_t& total) const 171 171 { 172 172 if (myIsWanted) … … 181 181 182 182 double 183 FileTreeItem ::progress () const183 FileTreeItem::progress () const 184 184 { 185 185 double d(0); … … 194 194 195 195 QString 196 FileTreeItem ::sizeString () const196 FileTreeItem::sizeString () const 197 197 { 198 198 QString str; … … 214 214 215 215 std::pair<int,int> 216 FileTreeItem ::update (const QString& name,217 218 219 220 216 FileTreeItem::update (const QString& name, 217 bool wanted, 218 int priority, 219 uint64_t haveSize, 220 bool updateFields) 221 221 { 222 222 int changed_count = 0; … … 267 267 268 268 QString 269 FileTreeItem ::priorityString () const269 FileTreeItem::priorityString () const 270 270 { 271 271 const int i = priority(); … … 281 281 282 282 int 283 FileTreeItem ::priority () const283 FileTreeItem::priority () const 284 284 { 285 285 int i(0); … … 310 310 311 311 void 312 FileTreeItem ::setSubtreePriority (int i, QSet<int>& ids)312 FileTreeItem::setSubtreePriority (int i, QSet<int>& ids) 313 313 { 314 314 if (myPriority != i) … … 325 325 326 326 void 327 FileTreeItem ::twiddlePriority (QSet<int>& ids, int& p)327 FileTreeItem::twiddlePriority (QSet<int>& ids, int& p) 328 328 { 329 329 const int old(priority()); … … 340 340 341 341 int 342 FileTreeItem ::isSubtreeWanted () const342 FileTreeItem::isSubtreeWanted () const 343 343 { 344 344 if(myChildren.isEmpty()) … … 364 364 365 365 void 366 FileTreeItem ::setSubtreeWanted (bool b, QSet<int>& ids)366 FileTreeItem::setSubtreeWanted (bool b, QSet<int>& ids) 367 367 { 368 368 if (myIsWanted != b) … … 379 379 380 380 void 381 FileTreeItem ::twiddleWanted (QSet<int>& ids, bool& wanted)381 FileTreeItem::twiddleWanted (QSet<int>& ids, bool& wanted) 382 382 { 383 383 wanted = isSubtreeWanted() != Qt::Checked; … … 386 386 387 387 QString 388 FileTreeItem ::path () const388 FileTreeItem::path () const 389 389 { 390 390 QString itemPath; … … 404 404 405 405 bool 406 FileTreeItem ::isComplete () const406 FileTreeItem::isComplete () const 407 407 { 408 408 return myHaveSize == totalSize (); … … 414 414 ***/ 415 415 416 FileTreeModel :: FileTreeModel (QObject *parent, bool isEditable):416 FileTreeModel::FileTreeModel (QObject * parent, bool isEditable): 417 417 QAbstractItemModel(parent), 418 418 myRootItem (new FileTreeItem), … … 422 422 } 423 423 424 FileTreeModel ::~FileTreeModel()424 FileTreeModel::~FileTreeModel() 425 425 { 426 426 clear(); … … 430 430 431 431 FileTreeItem * 432 FileTreeModel ::itemFromIndex (const QModelIndex& index) const432 FileTreeModel::itemFromIndex (const QModelIndex& index) const 433 433 { 434 434 return static_cast<FileTreeItem*>(index.internalPointer()); … … 436 436 437 437 QVariant 438 FileTreeModel ::data (const QModelIndex &index, int role) const438 FileTreeModel::data (const QModelIndex &index, int role) const 439 439 { 440 440 QVariant value; … … 447 447 448 448 Qt::ItemFlags 449 FileTreeModel ::flags (const QModelIndex& index) const449 FileTreeModel::flags (const QModelIndex& index) const 450 450 { 451 451 int i(Qt::ItemIsSelectable | Qt::ItemIsEnabled); … … 461 461 462 462 bool 463 FileTreeModel ::setData (const QModelIndex& index, const QVariant& newname, int role)463 FileTreeModel::setData (const QModelIndex& index, const QVariant& newname, int role) 464 464 { 465 465 if (role == Qt::EditRole) … … 474 474 475 475 QVariant 476 FileTreeModel ::headerData (int column, Qt::Orientation orientation, int role) const476 FileTreeModel::headerData (int column, Qt::Orientation orientation, int role) const 477 477 { 478 478 QVariant data; … … 511 511 512 512 QModelIndex 513 FileTreeModel ::index (int row, int column, const QModelIndex& parent) const513 FileTreeModel::index (int row, int column, const QModelIndex& parent) const 514 514 { 515 515 QModelIndex i; … … 534 534 535 535 QModelIndex 536 FileTreeModel ::parent (const QModelIndex& child) const536 FileTreeModel::parent (const QModelIndex& child) const 537 537 { 538 538 return parent (child, 0); // QAbstractItemModel::parent() wants col 0 … … 540 540 541 541 QModelIndex 542 FileTreeModel ::parent (const QModelIndex& child, int column) const542 FileTreeModel::parent (const QModelIndex& child, int column) const 543 543 { 544 544 QModelIndex parent; … … 551 551 552 552 int 553 FileTreeModel ::rowCount (const QModelIndex& parent) const553 FileTreeModel::rowCount (const QModelIndex& parent) const 554 554 { 555 555 FileTreeItem * parentItem; … … 564 564 565 565 int 566 FileTreeModel :: columnCount (const QModelIndex &parent) const566 FileTreeModel::columnCount (const QModelIndex& parent) const 567 567 { 568 568 Q_UNUSED(parent); … … 572 572 573 573 QModelIndex 574 FileTreeModel ::indexOf (FileTreeItem * item, int column) const574 FileTreeModel::indexOf (FileTreeItem * item, int column) const 575 575 { 576 576 if (!item || item==myRootItem) … … 581 581 582 582 void 583 FileTreeModel ::clearSubtree (const QModelIndex& top)583 FileTreeModel::clearSubtree (const QModelIndex& top) 584 584 { 585 585 size_t i = rowCount (top); … … 599 599 600 600 void 601 FileTreeModel ::clear ()601 FileTreeModel::clear () 602 602 { 603 603 beginResetModel (); … … 609 609 610 610 FileTreeItem * 611 FileTreeModel ::findItemForFileIndex (int fileIndex) const611 FileTreeModel::findItemForFileIndex (int fileIndex) const 612 612 { 613 613 return myIndexCache.value (fileIndex, 0); … … 615 615 616 616 void 617 FileTreeModel ::addFile (int fileIndex,618 619 620 621 622 623 624 617 FileTreeModel::addFile (int fileIndex, 618 const QString & filename, 619 bool wanted, 620 int priority, 621 uint64_t totalSize, 622 uint64_t have, 623 QList<QModelIndex> & rowsAdded, 624 bool updateFields) 625 625 { 626 626 bool added = false; … … 691 691 692 692 void 693 FileTreeModel ::parentsChanged (const QModelIndex& index, int firstColumn, int lastColumn)693 FileTreeModel::parentsChanged (const QModelIndex& index, int firstColumn, int lastColumn) 694 694 { 695 695 assert (firstColumn <= lastColumn); … … 708 708 709 709 void 710 FileTreeModel ::subtreeChanged (const QModelIndex& index, int firstColumn, int lastColumn)710 FileTreeModel::subtreeChanged (const QModelIndex& index, int firstColumn, int lastColumn) 711 711 { 712 712 assert (firstColumn <= lastColumn); … … 725 725 726 726 void 727 FileTreeModel ::clicked (const QModelIndex& index)727 FileTreeModel::clicked (const QModelIndex& index) 728 728 { 729 729 const int column (index.column()); … … 763 763 764 764 void 765 FileTreeModel ::doubleClicked (const QModelIndex& index)765 FileTreeModel::doubleClicked (const QModelIndex& index) 766 766 { 767 767 if (!index.isValid()) … … 783 783 784 784 QSize 785 FileTreeDelegate ::sizeHint(const QStyleOptionViewItem& item, const QModelIndex& index) const785 FileTreeDelegate::sizeHint(const QStyleOptionViewItem& item, const QModelIndex& index) const 786 786 { 787 787 QSize size; … … 803 803 804 804 void 805 FileTreeDelegate ::paint (QPainter * painter,806 807 805 FileTreeDelegate::paint (QPainter * painter, 806 const QStyleOptionViewItem & option, 807 const QModelIndex & index) const 808 808 { 809 809 const int column(index.column()); … … 815 815 } 816 816 817 QStyle * style (QApplication :: style());817 QStyle * style (QApplication::style ()); 818 818 819 819 painter->save(); … … 864 864 ****/ 865 865 866 FileTreeView ::FileTreeView (QWidget * parent, bool isEditable):866 FileTreeView::FileTreeView (QWidget * parent, bool isEditable): 867 867 QTreeView (parent), 868 868 myModel (this, isEditable), … … 912 912 } 913 913 914 FileTreeView ::~FileTreeView ()914 FileTreeView::~FileTreeView () 915 915 { 916 916 myProxy->deleteLater(); … … 918 918 919 919 void 920 FileTreeView ::onClicked (const QModelIndex& proxyIndex)920 FileTreeView::onClicked (const QModelIndex& proxyIndex) 921 921 { 922 922 const QModelIndex modelIndex = myProxy->mapToSource (proxyIndex); … … 925 925 926 926 void 927 FileTreeView ::onDoubleClicked (const QModelIndex& proxyIndex)927 FileTreeView::onDoubleClicked (const QModelIndex& proxyIndex) 928 928 { 929 929 const QModelIndex modelIndex = myProxy->mapToSource (proxyIndex); … … 932 932 933 933 void 934 FileTreeView ::onOpenRequested (const QString& path)934 FileTreeView::onOpenRequested (const QString& path) 935 935 { 936 936 if (state () == EditingState) … … 941 941 942 942 bool 943 FileTreeView ::eventFilter (QObject * o, QEvent * event)943 FileTreeView::eventFilter (QObject * o, QEvent * event) 944 944 { 945 945 // this is kind of a hack to get the last three columns be the … … 995 995 996 996 void 997 FileTreeView ::update (const FileList& files, bool updateFields)997 FileTreeView::update (const FileList& files, bool updateFields) 998 998 { 999 999 foreach (const TrFile file, files) … … 1007 1007 1008 1008 void 1009 FileTreeView ::clear ()1009 FileTreeView::clear () 1010 1010 { 1011 1011 myModel.clear(); -
trunk/qt/filterbar.cc
r14225 r14377 49 49 } 50 50 51 FilterBarComboBoxDelegate ::FilterBarComboBoxDelegate (QObject * parent, QComboBox * combo):51 FilterBarComboBoxDelegate::FilterBarComboBoxDelegate (QObject * parent, QComboBox * combo): 52 52 QItemDelegate (parent), 53 53 myCombo (combo) … … 56 56 57 57 bool 58 FilterBarComboBoxDelegate :: isSeparator (const QModelIndex &index)58 FilterBarComboBoxDelegate::isSeparator (const QModelIndex& index) 59 59 { 60 60 return index.data (Qt::AccessibleDescriptionRole).toString () == QLatin1String ("separator"); 61 61 } 62 62 void 63 FilterBarComboBoxDelegate ::setSeparator (QAbstractItemModel * model, const QModelIndex& index)63 FilterBarComboBoxDelegate::setSeparator (QAbstractItemModel * model, const QModelIndex& index) 64 64 { 65 65 model->setData (index, QString::fromLatin1 ("separator"), Qt::AccessibleDescriptionRole); … … 71 71 72 72 void 73 FilterBarComboBoxDelegate ::paint (QPainter * painter,74 75 73 FilterBarComboBoxDelegate::paint (QPainter * painter, 74 const QStyleOptionViewItem & option, 75 const QModelIndex & index) const 76 76 { 77 77 if (isSeparator (index)) … … 121 121 122 122 QSize 123 FilterBarComboBoxDelegate ::sizeHint (const QStyleOptionViewItem & option,124 123 FilterBarComboBoxDelegate::sizeHint (const QStyleOptionViewItem & option, 124 const QModelIndex & index) const 125 125 { 126 126 if (isSeparator (index)) … … 147 147 **/ 148 148 149 FilterBarComboBox ::FilterBarComboBox (QWidget * parent):149 FilterBarComboBox::FilterBarComboBox (QWidget * parent): 150 150 QComboBox (parent) 151 151 { … … 153 153 154 154 int 155 FilterBarComboBox ::currentCount () const155 FilterBarComboBox::currentCount () const 156 156 { 157 157 int count = 0; … … 165 165 166 166 void 167 FilterBarComboBox ::paintEvent (QPaintEvent * e)167 FilterBarComboBox::paintEvent (QPaintEvent * e) 168 168 { 169 169 Q_UNUSED (e); … … 227 227 228 228 FilterBarComboBox * 229 FilterBar ::createActivityCombo ()229 FilterBar::createActivityCombo () 230 230 { 231 231 FilterBarComboBox * c = new FilterBarComboBox (this); … … 300 300 301 301 void 302 FilterBar ::refreshTrackers ()302 FilterBar::refreshTrackers () 303 303 { 304 304 Favicons& favicons = dynamic_cast<MyApp*> (QApplication::instance ())->favicons; … … 393 393 394 394 FilterBarComboBox * 395 FilterBar ::createTrackerCombo (QStandardItemModel * model)395 FilterBar::createTrackerCombo (QStandardItemModel * model) 396 396 { 397 397 FilterBarComboBox * c = new FilterBarComboBox (this); … … 419 419 ****/ 420 420 421 FilterBar ::FilterBar (Prefs& prefs, TorrentModel& torrents, TorrentFilter& filter, QWidget * parent):421 FilterBar::FilterBar (Prefs& prefs, TorrentModel& torrents, TorrentFilter& filter, QWidget * parent): 422 422 QWidget (parent), 423 423 myPrefs (prefs), … … 477 477 // initialize our state 478 478 QList<int> initKeys; 479 initKeys << Prefs ::FILTER_MODE480 << Prefs ::FILTER_TRACKERS;479 initKeys << Prefs::FILTER_MODE 480 << Prefs::FILTER_TRACKERS; 481 481 foreach (int key, initKeys) 482 482 refreshPref (key); 483 483 } 484 484 485 FilterBar ::~FilterBar ()485 FilterBar::~FilterBar () 486 486 { 487 487 delete myRecountTimer; … … 493 493 494 494 void 495 FilterBar ::refreshPref (int key)495 FilterBar::refreshPref (int key) 496 496 { 497 497 switch (key) 498 498 { 499 case Prefs ::FILTER_MODE:499 case Prefs::FILTER_MODE: 500 500 { 501 501 const FilterMode m = myPrefs.get<FilterMode> (key); … … 506 506 } 507 507 508 case Prefs ::FILTER_TRACKERS:508 case Prefs::FILTER_TRACKERS: 509 509 { 510 510 const QString tracker = myPrefs.getString (key); … … 527 527 528 528 void 529 FilterBar ::onTextChanged (const QString& str)529 FilterBar::onTextChanged (const QString& str) 530 530 { 531 531 if (!myIsBootstrapping) … … 534 534 535 535 void 536 FilterBar ::onTrackerIndexChanged (int i)536 FilterBar::onTrackerIndexChanged (int i) 537 537 { 538 538 if (!myIsBootstrapping) … … 556 556 557 557 void 558 FilterBar ::onActivityIndexChanged (int i)558 FilterBar::onActivityIndexChanged (int i) 559 559 { 560 560 if (!myIsBootstrapping) … … 569 569 ***/ 570 570 571 void FilterBar ::onTorrentModelReset () { recountSoon (); }572 void FilterBar ::onTorrentModelRowsInserted (const QModelIndex&, int, int) { recountSoon (); }573 void FilterBar ::onTorrentModelRowsRemoved (const QModelIndex&, int, int) { recountSoon (); }574 void FilterBar ::onTorrentModelDataChanged (const QModelIndex&, const QModelIndex&) { recountSoon (); }575 576 void 577 FilterBar ::recountSoon ()571 void FilterBar::onTorrentModelReset () { recountSoon (); } 572 void FilterBar::onTorrentModelRowsInserted (const QModelIndex&, int, int) { recountSoon (); } 573 void FilterBar::onTorrentModelRowsRemoved (const QModelIndex&, int, int) { recountSoon (); } 574 void FilterBar::onTorrentModelDataChanged (const QModelIndex&, const QModelIndex&) { recountSoon (); } 575 576 void 577 FilterBar::recountSoon () 578 578 { 579 579 if (!myRecountTimer->isActive ()) … … 584 584 } 585 585 void 586 FilterBar ::recount ()586 FilterBar::recount () 587 587 { 588 588 QAbstractItemModel * model = myActivityCombo->model (); … … 605 605 606 606 QString 607 FilterBar ::getCountString (int n) const607 FilterBar::getCountString (int n) const 608 608 { 609 609 return QString ("%L1").arg (n); … … 611 611 612 612 void 613 FilterBar ::refreshCountLabel ()613 FilterBar::refreshCountLabel () 614 614 { 615 615 const int visibleCount = myFilter.rowCount (); -
trunk/qt/filters.cc
r14225 r14377 23 23 24 24 int 25 FilterMode :: modeFromName( const QString& name)25 FilterMode::modeFromName (const QString& name) 26 26 { 27 27 for (int i=0; i<NUM_MODES; ++i) … … 47 47 48 48 int 49 SortMode ::modeFromName (const QString& name)49 SortMode::modeFromName (const QString& name) 50 50 { 51 51 for (int i=0; i<NUM_MODES; ++i) -
trunk/qt/formatter.cc
r14225 r14377 30 30 31 31 void 32 Formatter ::initUnits ()32 Formatter::initUnits () 33 33 { 34 34 speed_K = 1000; … … 74 74 75 75 double 76 Speed ::KBps () const76 Speed::KBps () const 77 77 { 78 78 return _Bps / (double)speed_K; … … 80 80 81 81 Speed 82 Speed ::fromKBps (double KBps)82 Speed::fromKBps (double KBps) 83 83 { 84 84 return int (KBps * speed_K); … … 90 90 91 91 QString 92 Formatter ::memToString (int64_t bytes)92 Formatter::memToString (int64_t bytes) 93 93 { 94 94 if (bytes < 0) … … 104 104 105 105 QString 106 Formatter ::sizeToString (int64_t bytes)106 Formatter::sizeToString (int64_t bytes) 107 107 { 108 108 if (bytes < 0) … … 118 118 119 119 QString 120 Formatter ::speedToString (const Speed& speed)120 Formatter::speedToString (const Speed& speed) 121 121 { 122 122 char buf[128]; … … 126 126 127 127 QString 128 Formatter ::uploadSpeedToString (const Speed& uploadSpeed)128 Formatter::uploadSpeedToString (const Speed& uploadSpeed) 129 129 { 130 130 static const QChar uploadSymbol (0x25B4); … … 134 134 135 135 QString 136 Formatter ::downloadSpeedToString (const Speed& downloadSpeed)136 Formatter::downloadSpeedToString (const Speed& downloadSpeed) 137 137 { 138 138 static const QChar downloadSymbol (0x25BE); … … 142 142 143 143 QString 144 Formatter ::percentToString (double x)144 Formatter::percentToString (double x) 145 145 { 146 146 char buf[128]; … … 149 149 150 150 QString 151 Formatter ::ratioToString (double ratio)151 Formatter::ratioToString (double ratio) 152 152 { 153 153 char buf[128]; … … 156 156 157 157 QString 158 Formatter ::timeToString (int seconds)158 Formatter::timeToString (int seconds) 159 159 { 160 160 int days, hours, minutes; -
trunk/qt/freespace-label.cc
r14226 r14377 20 20 } 21 21 22 FreespaceLabel ::FreespaceLabel (Session & session,23 24 22 FreespaceLabel::FreespaceLabel (Session & session, 23 const QString & path, 24 QWidget * parent): 25 25 QLabel (parent), 26 26 mySession (session), … … 41 41 42 42 void 43 FreespaceLabel ::setPath (const QString& path)43 FreespaceLabel::setPath (const QString& path) 44 44 { 45 45 if (myPath != path) … … 52 52 53 53 void 54 FreespaceLabel ::onTimer ()54 FreespaceLabel::onTimer () 55 55 { 56 56 const int64_t tag = mySession.getUniqueTag (); … … 69 69 70 70 void 71 FreespaceLabel ::onSessionExecuted (int64_t tag, const QString& result, struct tr_variant * arguments)71 FreespaceLabel::onSessionExecuted (int64_t tag, const QString& result, struct tr_variant * arguments) 72 72 { 73 73 Q_UNUSED (result); -
trunk/qt/hig.cc
r14225 r14377 18 18 19 19 20 HIG ::HIG (QWidget * parent):20 HIG::HIG (QWidget * parent): 21 21 QWidget (parent), 22 22 myRow (0), … … 30 30 } 31 31 32 HIG ::~HIG ()32 HIG::~HIG () 33 33 { 34 34 delete myGrid; … … 40 40 41 41 void 42 HIG ::addSectionDivider ()42 HIG::addSectionDivider () 43 43 { 44 44 QWidget * w = new QWidget (this); … … 48 48 49 49 void 50 HIG ::addSectionTitle (const QString& title)50 HIG::addSectionTitle (const QString& title) 51 51 { 52 52 QLabel * label = new QLabel (this); … … 58 58 59 59 void 60 HIG ::addSectionTitle (QWidget * w)60 HIG::addSectionTitle (QWidget * w) 61 61 { 62 62 myGrid->addWidget (w, myRow, 0, 1, 2, Qt::AlignLeft|Qt::AlignVCenter); … … 65 65 66 66 void 67 HIG ::addSectionTitle (QLayout * l)67 HIG::addSectionTitle (QLayout * l) 68 68 { 69 69 myGrid->addLayout (l, myRow, 0, 1, 2, Qt::AlignLeft|Qt::AlignVCenter); … … 73 73 74 74 QLayout * 75 HIG ::addRow (QWidget * w)75 HIG::addRow (QWidget * w) 76 76 { 77 77 QHBoxLayout * h = new QHBoxLayout (); … … 87 87 88 88 void 89 HIG ::addWideControl (QLayout * l)89 HIG::addWideControl (QLayout * l) 90 90 { 91 91 QHBoxLayout * h = new QHBoxLayout (); … … 97 97 98 98 void 99 HIG ::addWideControl (QWidget * w)99 HIG::addWideControl (QWidget * w) 100 100 { 101 101 QHBoxLayout * h = new QHBoxLayout (); … … 107 107 108 108 QCheckBox* 109 HIG ::addWideCheckBox (const QString& text, bool isChecked)109 HIG::addWideCheckBox (const QString& text, bool isChecked) 110 110 { 111 111 QCheckBox * check = new QCheckBox (text, this); … … 116 116 117 117 void 118 HIG ::addLabel (QWidget * w)118 HIG::addLabel (QWidget * w) 119 119 { 120 120 QHBoxLayout * h = new QHBoxLayout (); … … 125 125 126 126 QLabel* 127 HIG ::addLabel (const QString& text)127 HIG::addLabel (const QString& text) 128 128 { 129 129 QLabel * label = new QLabel (text, this); … … 133 133 134 134 void 135 HIG ::addTallLabel (QWidget * w)135 HIG::addTallLabel (QWidget * w) 136 136 { 137 137 QHBoxLayout * h = new QHBoxLayout (); … … 142 142 143 143 QLabel* 144 HIG ::addTallLabel (const QString& text)144 HIG::addTallLabel (const QString& text) 145 145 { 146 146 QLabel * label = new QLabel (text, this); … … 150 150 151 151 void 152 HIG ::addControl (QWidget * w)152 HIG::addControl (QWidget * w) 153 153 { 154 154 myGrid->addWidget (w, myRow, 1, 1, 1); … … 156 156 157 157 void 158 HIG ::addControl (QLayout * l)158 HIG::addControl (QLayout * l) 159 159 { 160 160 myGrid->addLayout (l, myRow, 1, 1, 1); … … 162 162 163 163 QLabel * 164 HIG ::addRow (const QString& text, QWidget * control, QWidget * buddy)164 HIG::addRow (const QString& text, QWidget * control, QWidget * buddy) 165 165 { 166 166 QLabel * label = addLabel (text); … … 172 172 173 173 QLabel * 174 HIG ::addTallRow (const QString& text, QWidget * control, QWidget * buddy)174 HIG::addTallRow (const QString& text, QWidget * control, QWidget * buddy) 175 175 { 176 176 QLabel* label = addTallLabel (text); … … 184 184 185 185 QLabel * 186 HIG ::addRow (const QString& text, QLayout * control, QWidget * buddy)186 HIG::addRow (const QString& text, QLayout * control, QWidget * buddy) 187 187 { 188 188 QLabel * label = addLabel (text); … … 195 195 196 196 void 197 HIG ::addRow (QWidget * label, QWidget * control, QWidget * buddy)197 HIG::addRow (QWidget * label, QWidget * control, QWidget * buddy) 198 198 { 199 199 addLabel (label); … … 212 212 213 213 void 214 HIG ::addRow (QWidget * label, QLayout * control, QWidget * buddy)214 HIG::addRow (QWidget * label, QLayout * control, QWidget * buddy) 215 215 { 216 216 addLabel (label); … … 229 229 230 230 void 231 HIG ::finish ()231 HIG::finish () 232 232 { 233 233 if (!myHasTall) -
trunk/qt/license.cc
r14242 r14377 14 14 #include "license.h" 15 15 16 LicenseDialog ::LicenseDialog (QWidget * parent):16 LicenseDialog::LicenseDialog (QWidget * parent): 17 17 QDialog (parent, Qt::Dialog) 18 18 { -
trunk/qt/mainwin.cc
r14376 r14377 73 73 74 74 QIcon 75 TrMainWindow ::getStockIcon (const QString& name, int fallback)75 TrMainWindow::getStockIcon (const QString& name, int fallback) 76 76 { 77 77 QIcon icon = QIcon::fromTheme (name); … … 83 83 } 84 84 85 TrMainWindow ::TrMainWindow (Session& session, Prefs& prefs, TorrentModel& model, bool minimized):85 TrMainWindow::TrMainWindow (Session& session, Prefs& prefs, TorrentModel& model, bool minimized): 86 86 myLastFullUpdateTime (0), 87 87 mySessionDialog (new SessionDialog (session, prefs, this)), … … 249 249 250 250 QList<int> initKeys; 251 initKeys << Prefs ::MAIN_WINDOW_X252 << Prefs ::SHOW_TRAY_ICON253 << Prefs ::SORT_REVERSED254 << Prefs ::SORT_MODE255 << Prefs ::FILTERBAR256 << Prefs ::STATUSBAR257 << Prefs ::STATUSBAR_STATS258 << Prefs ::TOOLBAR259 << Prefs ::ALT_SPEED_LIMIT_ENABLED260 << Prefs ::COMPACT_VIEW261 << Prefs ::DSPEED262 << Prefs ::DSPEED_ENABLED263 << Prefs ::USPEED264 << Prefs ::USPEED_ENABLED265 << Prefs ::RATIO266 << Prefs ::RATIO_ENABLED;251 initKeys << Prefs::MAIN_WINDOW_X 252 << Prefs::SHOW_TRAY_ICON 253 << Prefs::SORT_REVERSED 254 << Prefs::SORT_MODE 255 << Prefs::FILTERBAR 256 << Prefs::STATUSBAR 257 << Prefs::STATUSBAR_STATS 258 << Prefs::TOOLBAR 259 << Prefs::ALT_SPEED_LIMIT_ENABLED 260 << Prefs::COMPACT_VIEW 261 << Prefs::DSPEED 262 << Prefs::DSPEED_ENABLED 263 << Prefs::USPEED 264 << Prefs::USPEED_ENABLED 265 << Prefs::RATIO 266 << Prefs::RATIO_ENABLED; 267 267 foreach (int key, initKeys) 268 268 refreshPref (key); … … 296 296 } 297 297 298 TrMainWindow ::~TrMainWindow ()298 TrMainWindow::~TrMainWindow () 299 299 { 300 300 } … … 305 305 306 306 void 307 TrMainWindow ::onSessionSourceChanged ()307 TrMainWindow::onSessionSourceChanged () 308 308 { 309 309 myModel.clear (); … … 311 311 312 312 void 313 TrMainWindow ::onModelReset ()313 TrMainWindow::onModelReset () 314 314 { 315 315 refreshTitle (); … … 326 326 327 327 void 328 TrMainWindow ::onSetPrefs ()328 TrMainWindow::onSetPrefs () 329 329 { 330 330 const QVariantList p = sender ()->property (PREF_VARIANTS_KEY).toList (); … … 335 335 336 336 void 337 TrMainWindow ::onSetPrefs (bool isChecked)337 TrMainWindow::onSetPrefs (bool isChecked) 338 338 { 339 339 if (isChecked) … … 344 344 345 345 QWidget * 346 TrMainWindow ::createStatusBar ()346 TrMainWindow::createStatusBar () 347 347 { 348 348 QMenu * m; … … 422 422 423 423 QMenu * 424 TrMainWindow ::createOptionsMenu ()424 TrMainWindow::createOptionsMenu () 425 425 { 426 426 QMenu * menu; … … 510 510 511 511 void 512 TrMainWindow ::setSortPref (int i)512 TrMainWindow::setSortPref (int i) 513 513 { 514 514 myPrefs.set (Prefs::SORT_MODE, SortMode (i)); 515 515 } 516 void TrMainWindow ::onSortByActivityToggled (bool b) { if (b) setSortPref (SortMode::SORT_BY_ACTIVITY); }517 void TrMainWindow ::onSortByAgeToggled (bool b) { if (b) setSortPref (SortMode::SORT_BY_AGE); }518 void TrMainWindow ::onSortByETAToggled (bool b) { if (b) setSortPref (SortMode::SORT_BY_ETA); }519 void TrMainWindow ::onSortByNameToggled (bool b) { if (b) setSortPref (SortMode::SORT_BY_NAME); }520 void TrMainWindow ::onSortByProgressToggled (bool b) { if (b) setSortPref (SortMode::SORT_BY_PROGRESS); }521 void TrMainWindow ::onSortByQueueToggled (bool b) { if (b) setSortPref (SortMode::SORT_BY_QUEUE); }522 void TrMainWindow ::onSortByRatioToggled (bool b) { if (b) setSortPref (SortMode::SORT_BY_RATIO); }523 void TrMainWindow ::onSortBySizeToggled (bool b) { if (b) setSortPref (SortMode::SORT_BY_SIZE); }524 void TrMainWindow ::onSortByStateToggled (bool b) { if (b) setSortPref (SortMode::SORT_BY_STATE); }525 526 void 527 TrMainWindow ::setSortAscendingPref (bool b)516 void TrMainWindow::onSortByActivityToggled (bool b) { if (b) setSortPref (SortMode::SORT_BY_ACTIVITY); } 517 void TrMainWindow::onSortByAgeToggled (bool b) { if (b) setSortPref (SortMode::SORT_BY_AGE); } 518 void TrMainWindow::onSortByETAToggled (bool b) { if (b) setSortPref (SortMode::SORT_BY_ETA); } 519 void TrMainWindow::onSortByNameToggled (bool b) { if (b) setSortPref (SortMode::SORT_BY_NAME); } 520 void TrMainWindow::onSortByProgressToggled (bool b) { if (b) setSortPref (SortMode::SORT_BY_PROGRESS); } 521 void TrMainWindow::onSortByQueueToggled (bool b) { if (b) setSortPref (SortMode::SORT_BY_QUEUE); } 522 void TrMainWindow::onSortByRatioToggled (bool b) { if (b) setSortPref (SortMode::SORT_BY_RATIO); } 523 void TrMainWindow::onSortBySizeToggled (bool b) { if (b) setSortPref (SortMode::SORT_BY_SIZE); } 524 void TrMainWindow::onSortByStateToggled (bool b) { if (b) setSortPref (SortMode::SORT_BY_STATE); } 525 526 void 527 TrMainWindow::setSortAscendingPref (bool b) 528 528 { 529 529 myPrefs.set (Prefs::SORT_REVERSED, b); … … 535 535 536 536 void 537 TrMainWindow ::showEvent (QShowEvent * event)537 TrMainWindow::showEvent (QShowEvent * event) 538 538 { 539 539 Q_UNUSED (event); … … 547 547 548 548 void 549 TrMainWindow ::hideEvent (QHideEvent * event)549 TrMainWindow::hideEvent (QHideEvent * event) 550 550 { 551 551 Q_UNUSED (event); … … 560 560 561 561 void 562 TrMainWindow ::onPrefsDestroyed ()562 TrMainWindow::onPrefsDestroyed () 563 563 { 564 564 myPrefsDialog = 0; … … 566 566 567 567 void 568 TrMainWindow ::openPreferences ()568 TrMainWindow::openPreferences () 569 569 { 570 570 if (myPrefsDialog == 0) … … 578 578 579 579 void 580 TrMainWindow ::onDetailsDestroyed ()580 TrMainWindow::onDetailsDestroyed () 581 581 { 582 582 myDetailsDialog = 0; … … 584 584 585 585 void 586 TrMainWindow ::openProperties ()586 TrMainWindow::openProperties () 587 587 { 588 588 if (myDetailsDialog == 0) … … 597 597 598 598 void 599 TrMainWindow ::setLocation ()599 TrMainWindow::setLocation () 600 600 { 601 601 QDialog * d = new RelocateDialog (mySession, myModel, getSelectedTorrents (), this); … … 635 635 636 636 void 637 TrMainWindow ::openFolder ()637 TrMainWindow::openFolder () 638 638 { 639 639 const int torrentId (*getSelectedTorrents ().begin ()); … … 654 654 } 655 655 #endif 656 QDesktopServices ::openUrl (QUrl::fromLocalFile (path));657 } 658 659 void 660 TrMainWindow ::copyMagnetLinkToClipboard ()656 QDesktopServices::openUrl (QUrl::fromLocalFile (path)); 657 } 658 659 void 660 TrMainWindow::copyMagnetLinkToClipboard () 661 661 { 662 662 const int id (*getSelectedTorrents ().begin ()); … … 665 665 666 666 void 667 TrMainWindow ::openDonate ()668 { 669 QDesktopServices ::openUrl (QUrl ("http://www.transmissionbt.com/donate.php"));670 } 671 672 void 673 TrMainWindow ::openHelp ()667 TrMainWindow::openDonate () 668 { 669 QDesktopServices::openUrl (QUrl ("http://www.transmissionbt.com/donate.php")); 670 } 671 672 void 673 TrMainWindow::openHelp () 674 674 { 675 675 const char * fmt = "http://www.transmissionbt.com/help/gtk/%d.%dx"; … … 678 678 char url[128]; 679 679 tr_snprintf (url, sizeof (url), fmt, major, minor/10); 680 QDesktopServices ::openUrl (QUrl (url));681 } 682 683 void 684 TrMainWindow ::refreshTitle ()680 QDesktopServices::openUrl (QUrl (url)); 681 } 682 683 void 684 TrMainWindow::refreshTitle () 685 685 { 686 686 QString title ("Transmission"); … … 692 692 693 693 void 694 TrMainWindow ::refreshTrayIconSoon ()694 TrMainWindow::refreshTrayIconSoon () 695 695 { 696 696 if (!myRefreshTrayIconTimer.isActive ()) … … 701 701 } 702 702 void 703 TrMainWindow ::refreshTrayIcon ()703 TrMainWindow::refreshTrayIcon () 704 704 { 705 705 Speed upSpeed, downSpeed; … … 731 731 732 732 void 733 TrMainWindow ::refreshStatusBar ()733 TrMainWindow::refreshStatusBar () 734 734 { 735 735 Speed upSpeed, downSpeed; … … 774 774 775 775 void 776 TrMainWindow ::refreshActionSensitivitySoon ()776 TrMainWindow::refreshActionSensitivitySoon () 777 777 { 778 778 if (!myRefreshActionSensitivityTimer.isActive ()) … … 783 783 } 784 784 void 785 TrMainWindow ::refreshActionSensitivity ()785 TrMainWindow::refreshActionSensitivity () 786 786 { 787 787 int selected (0); … … 849 849 850 850 void 851 TrMainWindow ::clearSelection ()851 TrMainWindow::clearSelection () 852 852 { 853 853 ui.action_DeselectAll->trigger (); … … 855 855 856 856 QSet<int> 857 TrMainWindow ::getSelectedTorrents () const857 TrMainWindow::getSelectedTorrents () const 858 858 { 859 859 QSet<int> ids; … … 869 869 870 870 void 871 TrMainWindow ::startSelected ()871 TrMainWindow::startSelected () 872 872 { 873 873 mySession.startTorrents (getSelectedTorrents ()); 874 874 } 875 875 void 876 TrMainWindow ::startSelectedNow ()876 TrMainWindow::startSelectedNow () 877 877 { 878 878 mySession.startTorrentsNow (getSelectedTorrents ()); 879 879 } 880 880 void 881 TrMainWindow ::pauseSelected ()881 TrMainWindow::pauseSelected () 882 882 { 883 883 mySession.pauseTorrents (getSelectedTorrents ()); 884 884 } 885 885 void 886 TrMainWindow ::queueMoveTop ()886 TrMainWindow::queueMoveTop () 887 887 { 888 888 mySession.queueMoveTop (getSelectedTorrents ()); 889 889 } 890 890 void 891 TrMainWindow ::queueMoveUp ()891 TrMainWindow::queueMoveUp () 892 892 { 893 893 mySession.queueMoveUp (getSelectedTorrents ()); 894 894 } 895 895 void 896 TrMainWindow ::queueMoveDown ()896 TrMainWindow::queueMoveDown () 897 897 { 898 898 mySession.queueMoveDown (getSelectedTorrents ()); 899 899 } 900 900 void 901 TrMainWindow ::queueMoveBottom ()901 TrMainWindow::queueMoveBottom () 902 902 { 903 903 mySession.queueMoveBottom (getSelectedTorrents ()); 904 904 } 905 905 void 906 TrMainWindow ::startAll ()906 TrMainWindow::startAll () 907 907 { 908 908 mySession.startTorrents (); 909 909 } 910 910 void 911 TrMainWindow ::pauseAll ()911 TrMainWindow::pauseAll () 912 912 { 913 913 mySession.pauseTorrents (); 914 914 } 915 915 void 916 TrMainWindow ::removeSelected ()916 TrMainWindow::removeSelected () 917 917 { 918 918 removeTorrents (false); 919 919 } 920 920 void 921 TrMainWindow ::deleteSelected ()921 TrMainWindow::deleteSelected () 922 922 { 923 923 removeTorrents (true); 924 924 } 925 925 void 926 TrMainWindow ::verifySelected ()926 TrMainWindow::verifySelected () 927 927 { 928 928 mySession.verifyTorrents (getSelectedTorrents ()); 929 929 } 930 930 void 931 TrMainWindow ::reannounceSelected ()931 TrMainWindow::reannounceSelected () 932 932 { 933 933 mySession.reannounceTorrents (getSelectedTorrents ()); … … 938 938 **/ 939 939 940 void TrMainWindow ::showTotalRatio () { myPrefs.set (Prefs::STATUSBAR_STATS, "total-ratio"); }941 void TrMainWindow ::showTotalTransfer () { myPrefs.set (Prefs::STATUSBAR_STATS, "total-transfer"); }942 void TrMainWindow ::showSessionRatio () { myPrefs.set (Prefs::STATUSBAR_STATS, "session-ratio"); }943 void TrMainWindow ::showSessionTransfer () { myPrefs.set (Prefs::STATUSBAR_STATS, "session-transfer"); }940 void TrMainWindow::showTotalRatio () { myPrefs.set (Prefs::STATUSBAR_STATS, "total-ratio"); } 941 void TrMainWindow::showTotalTransfer () { myPrefs.set (Prefs::STATUSBAR_STATS, "total-transfer"); } 942 void TrMainWindow::showSessionRatio () { myPrefs.set (Prefs::STATUSBAR_STATS, "session-ratio"); } 943 void TrMainWindow::showSessionTransfer () { myPrefs.set (Prefs::STATUSBAR_STATS, "session-transfer"); } 944 944 945 945 /** … … 948 948 949 949 void 950 TrMainWindow ::setCompactView (bool visible)951 { 952 myPrefs.set (Prefs ::COMPACT_VIEW, visible);953 } 954 void 955 TrMainWindow ::toggleSpeedMode ()956 { 957 myPrefs.toggleBool (Prefs ::ALT_SPEED_LIMIT_ENABLED);950 TrMainWindow::setCompactView (bool visible) 951 { 952 myPrefs.set (Prefs::COMPACT_VIEW, visible); 953 } 954 void 955 TrMainWindow::toggleSpeedMode () 956 { 957 myPrefs.toggleBool (Prefs::ALT_SPEED_LIMIT_ENABLED); 958 958 const bool mode = myPrefs.get<bool> (Prefs::ALT_SPEED_LIMIT_ENABLED); 959 959 myAltSpeedAction->setIcon (mode ? mySpeedModeOnIcon : mySpeedModeOffIcon); 960 960 } 961 961 void 962 TrMainWindow ::setToolbarVisible (bool visible)962 TrMainWindow::setToolbarVisible (bool visible) 963 963 { 964 964 myPrefs.set (Prefs::TOOLBAR, visible); 965 965 } 966 966 void 967 TrMainWindow ::setFilterbarVisible (bool visible)967 TrMainWindow::setFilterbarVisible (bool visible) 968 968 { 969 969 myPrefs.set (Prefs::FILTERBAR, visible); 970 970 } 971 971 void 972 TrMainWindow ::setStatusbarVisible (bool visible)972 TrMainWindow::setStatusbarVisible (bool visible) 973 973 { 974 974 myPrefs.set (Prefs::STATUSBAR, visible); … … 980 980 981 981 void 982 TrMainWindow ::toggleWindows (bool doShow)982 TrMainWindow::toggleWindows (bool doShow) 983 983 { 984 984 if (!doShow) … … 997 997 998 998 void 999 TrMainWindow ::trayActivated (QSystemTrayIcon::ActivationReason reason)999 TrMainWindow::trayActivated (QSystemTrayIcon::ActivationReason reason) 1000 1000 { 1001 1001 if ((reason == QSystemTrayIcon::Trigger) || … … 1011 1011 1012 1012 void 1013 TrMainWindow ::refreshPref (int key)1013 TrMainWindow::refreshPref (int key) 1014 1014 { 1015 1015 bool b; … … 1119 1119 break; 1120 1120 1121 case Prefs ::ALT_SPEED_LIMIT_ENABLED:1122 case Prefs ::ALT_SPEED_LIMIT_UP:1123 case Prefs ::ALT_SPEED_LIMIT_DOWN:1121 case Prefs::ALT_SPEED_LIMIT_ENABLED: 1122 case Prefs::ALT_SPEED_LIMIT_UP: 1123 case Prefs::ALT_SPEED_LIMIT_DOWN: 1124 1124 { 1125 b = myPrefs.getBool (Prefs ::ALT_SPEED_LIMIT_ENABLED);1125 b = myPrefs.getBool (Prefs::ALT_SPEED_LIMIT_ENABLED); 1126 1126 myAltSpeedButton->setChecked (b); 1127 1127 myAltSpeedButton->setIcon (b ? mySpeedModeOnIcon : mySpeedModeOffIcon); … … 1147 1147 1148 1148 void 1149 TrMainWindow ::newTorrent ()1149 TrMainWindow::newTorrent () 1150 1150 { 1151 1151 MakeDialog * dialog = new MakeDialog (mySession, this); … … 1154 1154 1155 1155 void 1156 TrMainWindow ::openTorrent ()1156 TrMainWindow::openTorrent () 1157 1157 { 1158 1158 QFileDialog * d; … … 1182 1182 1183 1183 void 1184 TrMainWindow ::openURL ()1184 TrMainWindow::openURL () 1185 1185 { 1186 1186 QString str = QApplication::clipboard ()->text (QClipboard::Selection); … … 1196 1196 1197 1197 void 1198 TrMainWindow ::addTorrents (const QStringList& filenames)1198 TrMainWindow::addTorrents (const QStringList& filenames) 1199 1199 { 1200 1200 bool showOptions = myPrefs.getBool (Prefs::OPTIONS_PROMPT); … … 1213 1213 1214 1214 void 1215 TrMainWindow ::addTorrent (const AddData& addMe, bool showOptions)1215 TrMainWindow::addTorrent (const AddData& addMe, bool showOptions) 1216 1216 { 1217 1217 if (showOptions) … … 1219 1219 Options * o = new Options (mySession, myPrefs, addMe, this); 1220 1220 o->show (); 1221 QApplication ::alert (o);1221 QApplication::alert (o); 1222 1222 } 1223 1223 else 1224 1224 { 1225 1225 mySession.addTorrent (addMe); 1226 QApplication ::alert (this);1227 } 1228 } 1229 1230 void 1231 TrMainWindow ::removeTorrents (const bool deleteFiles)1226 QApplication::alert (this); 1227 } 1228 } 1229 1230 void 1231 TrMainWindow::removeTorrents (const bool deleteFiles) 1232 1232 { 1233 1233 QSet<int> ids; … … 1336 1336 1337 1337 void 1338 TrMainWindow ::updateNetworkIcon ()1338 TrMainWindow::updateNetworkIcon () 1339 1339 { 1340 1340 const time_t now = time (NULL); … … 1377 1377 1378 1378 void 1379 TrMainWindow ::onNetworkTimer ()1379 TrMainWindow::onNetworkTimer () 1380 1380 { 1381 1381 updateNetworkIcon (); … … 1383 1383 1384 1384 void 1385 TrMainWindow ::dataReadProgress ()1385 TrMainWindow::dataReadProgress () 1386 1386 { 1387 1387 if (!myNetworkError) … … 1390 1390 1391 1391 void 1392 TrMainWindow ::dataSendProgress ()1392 TrMainWindow::dataSendProgress () 1393 1393 { 1394 1394 myLastSendTime = time (NULL); … … 1396 1396 1397 1397 void 1398 TrMainWindow ::onError (QNetworkReply::NetworkError code)1398 TrMainWindow::onError (QNetworkReply::NetworkError code) 1399 1399 { 1400 1400 const bool hadError = myNetworkError; … … 1413 1413 1414 1414 void 1415 TrMainWindow ::errorMessage (const QString msg)1415 TrMainWindow::errorMessage (const QString msg) 1416 1416 { 1417 1417 myErrorMessage = msg; … … 1419 1419 1420 1420 void 1421 TrMainWindow ::wrongAuthentication ()1421 TrMainWindow::wrongAuthentication () 1422 1422 { 1423 1423 mySession.stop (); … … 1430 1430 1431 1431 void 1432 TrMainWindow ::dragEnterEvent (QDragEnterEvent * event)1432 TrMainWindow::dragEnterEvent (QDragEnterEvent * event) 1433 1433 { 1434 1434 const QMimeData * mime = event->mimeData (); … … 1442 1442 1443 1443 void 1444 TrMainWindow ::dropEvent (QDropEvent * event)1444 TrMainWindow::dropEvent (QDropEvent * event) 1445 1445 { 1446 1446 QStringList list; … … 1477 1477 1478 1478 void 1479 TrMainWindow ::contextMenuEvent (QContextMenuEvent * event)1479 TrMainWindow::contextMenuEvent (QContextMenuEvent * event) 1480 1480 { 1481 1481 QMenu * menu = new QMenu (this); -
trunk/qt/make-dialog.cc
r14225 r14377 44 44 45 45 void 46 MakeDialog ::onNewDialogDestroyed (QObject * o)46 MakeDialog::onNewDialogDestroyed (QObject * o) 47 47 { 48 48 Q_UNUSED (o); … … 52 52 53 53 void 54 MakeDialog ::onNewButtonBoxClicked (QAbstractButton * button)54 MakeDialog::onNewButtonBoxClicked (QAbstractButton * button) 55 55 { 56 56 switch (myNewButtonBox->standardButton (button)) … … 72 72 73 73 void 74 MakeDialog ::onProgress ()74 MakeDialog::onProgress () 75 75 { 76 76 // progress bar … … 105 105 106 106 void 107 MakeDialog ::makeTorrent ()107 MakeDialog::makeTorrent () 108 108 { 109 109 if (!myBuilder) … … 173 173 174 174 void 175 MakeDialog ::onFileClicked ()175 MakeDialog::onFileClicked () 176 176 { 177 177 QFileDialog * d = new QFileDialog (this, tr ("Select File")); … … 183 183 } 184 184 void 185 MakeDialog ::onFileSelected (const QStringList& list)185 MakeDialog::onFileSelected (const QStringList& list) 186 186 { 187 187 if (!list.empty ()) … … 189 189 } 190 190 void 191 MakeDialog ::onFileSelected (const QString& filename)191 MakeDialog::onFileSelected (const QString& filename) 192 192 { 193 193 myFile = Utils::removeTrailingDirSeparator (filename); … … 197 197 198 198 void 199 MakeDialog ::onFolderClicked ()199 MakeDialog::onFolderClicked () 200 200 { 201 201 QFileDialog * d = new QFileDialog (this, tr ("Select Folder")); … … 209 209 210 210 void 211 MakeDialog ::onFolderSelected (const QStringList& list)211 MakeDialog::onFolderSelected (const QStringList& list) 212 212 { 213 213 if (!list.empty ()) … … 216 216 217 217 void 218 MakeDialog ::onFolderSelected (const QString& filename)218 MakeDialog::onFolderSelected (const QString& filename) 219 219 { 220 220 myFolder = Utils::removeTrailingDirSeparator (filename); … … 224 224 225 225 void 226 MakeDialog ::onDestinationClicked ()226 MakeDialog::onDestinationClicked () 227 227 { 228 228 QFileDialog * d = new QFileDialog (this, tr ("Select Folder")); … … 235 235 } 236 236 void 237 MakeDialog ::onDestinationSelected (const QStringList& list)237 MakeDialog::onDestinationSelected (const QStringList& list) 238 238 { 239 239 if (!list.empty ()) … … 241 241 } 242 242 void 243 MakeDialog ::onDestinationSelected (const QString& filename)243 MakeDialog::onDestinationSelected (const QString& filename) 244 244 { 245 245 myDestination = Utils::removeTrailingDirSeparator (filename); … … 248 248 249 249 void 250 MakeDialog ::enableBuddyWhenChecked (QRadioButton * box, QWidget * buddy)250 MakeDialog::enableBuddyWhenChecked (QRadioButton * box, QWidget * buddy) 251 251 { 252 252 connect (box, SIGNAL(toggled(bool)), buddy, SLOT(setEnabled(bool))); … … 254 254 } 255 255 void 256 MakeDialog ::enableBuddyWhenChecked (QCheckBox * box, QWidget * buddy)256 MakeDialog::enableBuddyWhenChecked (QCheckBox * box, QWidget * buddy) 257 257 { 258 258 connect (box, SIGNAL(toggled(bool)), buddy, SLOT(setEnabled(bool))); … … 261 261 262 262 QString 263 MakeDialog ::getSource () const263 MakeDialog::getSource () const 264 264 { 265 265 return myFileRadio->isChecked () ? myFile : myFolder; … … 267 267 268 268 void 269 MakeDialog ::onButtonBoxClicked (QAbstractButton * button)269 MakeDialog::onButtonBoxClicked (QAbstractButton * button) 270 270 { 271 271 switch (myButtonBox->standardButton (button)) … … 286 286 287 287 void 288 MakeDialog ::onSourceChanged ()288 MakeDialog::onSourceChanged () 289 289 { 290 290 if (myBuilder) … … 328 328 }; 329 329 330 MakeDialog :: MakeDialog (Session& session, QWidget * parent):330 MakeDialog::MakeDialog (Session& session, QWidget * parent): 331 331 QDialog (parent, Qt::Dialog), 332 332 mySession (session), … … 339 339 setWindowTitle (tr ("New Torrent")); 340 340 QVBoxLayout * top = new QVBoxLayout (this); 341 top->setSpacing (HIG ::PAD);341 top->setSpacing (HIG::PAD); 342 342 343 343 HIG * hig = new HIG; … … 420 420 } 421 421 422 MakeDialog ::~MakeDialog ()422 MakeDialog::~MakeDialog () 423 423 { 424 424 if (myBuilder) … … 431 431 432 432 void 433 MakeDialog ::dragEnterEvent (QDragEnterEvent * event)433 MakeDialog::dragEnterEvent (QDragEnterEvent * event) 434 434 { 435 435 const QMimeData * mime = event->mimeData (); … … 440 440 441 441 void 442 MakeDialog ::dropEvent (QDropEvent * event)442 MakeDialog::dropEvent (QDropEvent * event) 443 443 { 444 444 const QString filename = event->mimeData()->urls().front().path(); -
trunk/qt/options.cc
r14349 r14377 44 44 ***/ 45 45 46 Options ::Options (Session& session, const Prefs& prefs, const AddData& addme, QWidget * parent):46 Options::Options (Session& session, const Prefs& prefs, const AddData& addme, QWidget * parent): 47 47 QDialog (parent, Qt::Dialog), 48 48 mySession (session), … … 73 73 connect (&myEditTimer, SIGNAL (timeout ()), this, SLOT (onDestinationEditedIdle ())); 74 74 75 const int iconSize (style ()->pixelMetric (QStyle ::PM_SmallIconSize));75 const int iconSize (style ()->pixelMetric (QStyle::PM_SmallIconSize)); 76 76 QIcon fileIcon = style ()->standardIcon (QStyle::SP_FileIcon); 77 77 const QPixmap filePixmap = fileIcon.pixmap (iconSize); … … 164 164 QCheckBox * c; 165 165 c = myStartCheck = new QCheckBox (tr ("S&tart when added")); 166 c->setChecked (prefs.getBool (Prefs ::START));166 c->setChecked (prefs.getBool (Prefs::START)); 167 167 layout->addWidget (c, ++row, 0, 1, 2, Qt::AlignLeft); 168 168 169 169 c = myTrashCheck = new QCheckBox (tr ("Mo&ve .torrent file to the trash")); 170 c->setChecked (prefs.getBool (Prefs ::TRASH_ORIGINAL));170 c->setChecked (prefs.getBool (Prefs::TRASH_ORIGINAL)); 171 171 layout->addWidget (c, ++row, 0, 1, 2, Qt::AlignLeft); 172 172 … … 178 178 layout->setRowStretch (3, 2); 179 179 layout->setColumnStretch (1, 2); 180 layout->setSpacing (HIG ::PAD);180 layout->setSpacing (HIG::PAD); 181 181 182 182 connect (myTree, SIGNAL (priorityChanged (const QSet<int>&,int)), this, SLOT (onPriorityChanged (const QSet<int>&,int))); … … 190 190 } 191 191 192 Options ::~Options ()192 Options::~Options () 193 193 { 194 194 clearInfo (); … … 200 200 201 201 void 202 Options ::refreshButton (QPushButton * p, const QString& text, int width)202 Options::refreshButton (QPushButton * p, const QString& text, int width) 203 203 { 204 204 if (width <= 0) … … 211 211 212 212 void 213 Options ::refreshSource (int width)213 Options::refreshSource (int width) 214 214 { 215 215 QString text = myAdd.readableName (); … … 223 223 224 224 void 225 Options ::refreshDestinationButton (int width)225 Options::refreshDestinationButton (int width) 226 226 { 227 227 if (myDestinationButton != 0) … … 231 231 232 232 bool 233 Options ::eventFilter (QObject * o, QEvent * event)233 Options::eventFilter (QObject * o, QEvent * event) 234 234 { 235 235 if (event->type() == QEvent::Resize) … … 250 250 251 251 void 252 Options ::clearInfo ()252 Options::clearInfo () 253 253 { 254 254 if (myHaveInfo) … … 260 260 261 261 void 262 Options ::reload ()262 Options::reload () 263 263 { 264 264 clearInfo (); … … 320 320 321 321 void 322 Options ::onPriorityChanged (const QSet<int>& fileIndices, int priority)322 Options::onPriorityChanged (const QSet<int>& fileIndices, int priority) 323 323 { 324 324 foreach (int i, fileIndices) … … 327 327 328 328 void 329 Options ::onWantedChanged (const QSet<int>& fileIndices, bool isWanted)329 Options::onWantedChanged (const QSet<int>& fileIndices, bool isWanted) 330 330 { 331 331 foreach (int i, fileIndices) … … 334 334 335 335 void 336 Options ::onAccepted ()336 Options::onAccepted () 337 337 { 338 338 // rpc spec section 3.4 "adding a torrent" … … 396 396 397 397 void 398 Options ::onFilenameClicked ()398 Options::onFilenameClicked () 399 399 { 400 400 if (myAdd.type == AddData::FILENAME) … … 412 412 413 413 void 414 Options ::onFilesSelected (const QStringList& files)414 Options::onFilesSelected (const QStringList& files) 415 415 { 416 416 if (files.size () == 1) … … 423 423 424 424 void 425 Options ::onSourceEditingFinished ()425 Options::onSourceEditingFinished () 426 426 { 427 427 myAdd.set (mySourceEdit->text()); … … 429 429 430 430 void 431 Options ::onDestinationClicked ()431 Options::onDestinationClicked () 432 432 { 433 433 QFileDialog * d = new QFileDialog (this, tr ("Select Destination"), myLocalDestination.absolutePath ()); … … 439 439 440 440 void 441 Options ::onDestinationsSelected (const QStringList& destinations)441 Options::onDestinationsSelected (const QStringList& destinations) 442 442 { 443 443 if (destinations.size () == 1) … … 451 451 452 452 void 453 Options ::onDestinationEdited (const QString& text)453 Options::onDestinationEdited (const QString& text) 454 454 { 455 455 Q_UNUSED (text); … … 459 459 460 460 void 461 Options ::onDestinationEditedIdle ()461 Options::onDestinationEditedIdle () 462 462 { 463 463 myFreespaceLabel->setPath (myDestinationEdit->text()); … … 471 471 472 472 void 473 Options ::clearVerify ()473 Options::clearVerify () 474 474 { 475 475 myVerifyHash.reset (); … … 489 489 490 490 void 491 Options ::onVerify ()491 Options::onVerify () 492 492 { 493 493 clearVerify (); … … 508 508 509 509 void 510 Options ::onTimeout ()510 Options::onTimeout () 511 511 { 512 512 if (myFiles.isEmpty()) -
trunk/qt/prefs-dialog.cc
r14329 r14377 52 52 53 53 void 54 PrefsDialog ::checkBoxToggled (bool checked)54 PrefsDialog::checkBoxToggled (bool checked) 55 55 { 56 56 const int key (sender ()->property (PREF_KEY).toInt ()); … … 59 59 60 60 QCheckBox * 61 PrefsDialog ::checkBoxNew (const QString& text, int key)61 PrefsDialog::checkBoxNew (const QString& text, int key) 62 62 { 63 63 QCheckBox * box = new QCheckBox (text); … … 70 70 71 71 void 72 PrefsDialog ::enableBuddyWhenChecked (QCheckBox * box, QWidget * buddy)72 PrefsDialog::enableBuddyWhenChecked (QCheckBox * box, QWidget * buddy) 73 73 { 74 74 connect (box, SIGNAL(toggled(bool)), buddy, SLOT(setEnabled(bool))); … … 77 77 78 78 void 79 PrefsDialog :: spinBoxEditingFinished()79 PrefsDialog::spinBoxEditingFinished () 80 80 { 81 81 const QObject * spin = sender(); … … 90 90 91 91 QSpinBox * 92 PrefsDialog ::spinBoxNew (int key, int low, int high, int step)92 PrefsDialog::spinBoxNew (int key, int low, int high, int step) 93 93 { 94 94 QSpinBox * spin = new QSpinBox (); … … 103 103 104 104 QDoubleSpinBox * 105 PrefsDialog ::doubleSpinBoxNew (int key, double low, double high, double step, int decimals)105 PrefsDialog::doubleSpinBoxNew (int key, double low, double high, double step, int decimals) 106 106 { 107 107 QDoubleSpinBox * spin = new QDoubleSpinBox (); … … 143 143 144 144 void 145 PrefsDialog ::lineEditingFinished ()145 PrefsDialog::lineEditingFinished () 146 146 { 147 147 QLineEdit * e = qobject_cast<QLineEdit*>(sender()); … … 155 155 156 156 QLineEdit* 157 PrefsDialog ::lineEditNew (int key, int echoMode)157 PrefsDialog::lineEditNew (int key, int echoMode) 158 158 { 159 159 QLineEdit * e = new QLineEdit (myPrefs.getString (key)); … … 170 170 171 171 QWidget * 172 PrefsDialog ::createRemoteTab (Session& session)172 PrefsDialog::createRemoteTab (Session& session) 173 173 { 174 174 HIG * hig = new HIG (this); … … 204 204 205 205 void 206 PrefsDialog ::altSpeedDaysEdited (int i)206 PrefsDialog::altSpeedDaysEdited (int i) 207 207 { 208 208 const int value = qobject_cast<QComboBox*>(sender())->itemData(i).toInt(); … … 212 212 213 213 QWidget * 214 PrefsDialog ::createSpeedTab ()214 PrefsDialog::createSpeedTab () 215 215 { 216 216 QWidget *l, *r; … … 231 231 hig->addSectionDivider (); 232 232 QHBoxLayout * h = new QHBoxLayout; 233 h->setSpacing (HIG ::PAD);233 h->setSpacing (HIG::PAD); 234 234 QLabel * label = new QLabel; 235 235 label->setPixmap (QPixmap (QString::fromUtf8 (":/icons/alt-limit-off.png"))); … … 246 246 247 247 s = tr ("U&pload (%1):").arg (speed_K_str); 248 r = spinBoxNew (Prefs ::ALT_SPEED_LIMIT_UP, 0, INT_MAX, 5);248 r = spinBoxNew (Prefs::ALT_SPEED_LIMIT_UP, 0, INT_MAX, 5); 249 249 hig->addRow (s, r); 250 250 251 251 s = tr ("Do&wnload (%1):").arg (speed_K_str); 252 r = spinBoxNew (Prefs ::ALT_SPEED_LIMIT_DOWN, 0, INT_MAX, 5);252 r = spinBoxNew (Prefs::ALT_SPEED_LIMIT_DOWN, 0, INT_MAX, 5); 253 253 hig->addRow (s, r); 254 254 … … 256 256 h = new QHBoxLayout (); 257 257 h->setSpacing (HIG::PAD); 258 QWidget * w = timeEditNew (Prefs ::ALT_SPEED_LIMIT_TIME_BEGIN);258 QWidget * w = timeEditNew (Prefs::ALT_SPEED_LIMIT_TIME_BEGIN); 259 259 h->addWidget (w, 1); 260 260 mySchedWidgets << w; … … 262 262 h->addWidget (nd); 263 263 mySchedWidgets << nd; 264 w = timeEditNew (Prefs ::ALT_SPEED_LIMIT_TIME_END);264 w = timeEditNew (Prefs::ALT_SPEED_LIMIT_TIME_END); 265 265 nd->setBuddy (w); 266 266 h->addWidget (w, 1); … … 281 281 box->addItem (noIcon, tr ("Friday"), QVariant (TR_SCHED_FRI)); 282 282 box->addItem (noIcon, tr ("Saturday"), QVariant (TR_SCHED_SAT)); 283 box->setCurrentIndex (box->findData (myPrefs.getInt (Prefs ::ALT_SPEED_LIMIT_TIME_DAY)));283 box->setCurrentIndex (box->findData (myPrefs.getInt (Prefs::ALT_SPEED_LIMIT_TIME_DAY))); 284 284 connect (box, SIGNAL(activated(int)), this, SLOT(altSpeedDaysEdited(int))); 285 285 w = hig->addRow (s, box); … … 295 295 296 296 QWidget * 297 PrefsDialog ::createDesktopTab ()297 PrefsDialog::createDesktopTab () 298 298 { 299 299 HIG * hig = new HIG (this); … … 319 319 320 320 void 321 PrefsDialog ::onPortTested (bool isOpen)321 PrefsDialog::onPortTested (bool isOpen) 322 322 { 323 323 myPortButton->setEnabled (true); … … 328 328 329 329 void 330 PrefsDialog ::onPortTest ()330 PrefsDialog::onPortTest () 331 331 { 332 332 myPortLabel->setText (tr ("Testing TCP Port...")); … … 337 337 338 338 QWidget * 339 PrefsDialog ::createNetworkTab ()339 PrefsDialog::createNetworkTab () 340 340 { 341 341 HIG * hig = new HIG (this); … … 347 347 QLabel * l = myPortLabel = new QLabel (tr ("Status unknown")); 348 348 h->addWidget (l); 349 h->addSpacing (HIG ::PAD_BIG);349 h->addSpacing (HIG::PAD_BIG); 350 350 h->addWidget (b); 351 351 h->setStretchFactor (l, 1); … … 355 355 hig->addRow (tr ("&Port for incoming connections:"), s); 356 356 hig->addRow (QString(), h, 0); 357 hig->addWideControl (checkBoxNew (tr ("Pick a &random port every time Transmission is started"), Prefs ::PEER_PORT_RANDOM_ON_START));357 hig->addWideControl (checkBoxNew (tr ("Pick a &random port every time Transmission is started"), Prefs::PEER_PORT_RANDOM_ON_START)); 358 358 hig->addWideControl (checkBoxNew (tr ("Use UPnP or NAT-PMP port &forwarding from my router"), Prefs::PORT_FORWARDING)); 359 359 … … 385 385 386 386 void 387 PrefsDialog ::onBlocklistDialogDestroyed (QObject * o)387 PrefsDialog::onBlocklistDialogDestroyed (QObject * o) 388 388 { 389 389 Q_UNUSED (o); … … 393 393 394 394 void 395 PrefsDialog ::onUpdateBlocklistCancelled ()395 PrefsDialog::onUpdateBlocklistCancelled () 396 396 { 397 397 disconnect (&mySession, SIGNAL(blocklistUpdated(int)), this, SLOT(onBlocklistUpdated(int))); … … 400 400 401 401 void 402 PrefsDialog ::onBlocklistUpdated (int n)402 PrefsDialog::onBlocklistUpdated (int n) 403 403 { 404 404 myBlocklistDialog->setText (tr ("<b>Update succeeded!</b><p>Blocklist now has %Ln rules.", 0, n)); … … 407 407 408 408 void 409 PrefsDialog ::onUpdateBlocklistClicked ()409 PrefsDialog::onUpdateBlocklistClicked () 410 410 { 411 411 myBlocklistDialog = new QMessageBox (QMessageBox::Information, … … 421 421 422 422 void 423 PrefsDialog ::encryptionEdited (int i)423 PrefsDialog::encryptionEdited (int i) 424 424 { 425 425 const int value (qobject_cast<QComboBox*>(sender())->itemData(i).toInt ()); … … 428 428 429 429 QWidget * 430 PrefsDialog ::createPrivacyTab ()430 PrefsDialog::createPrivacyTab () 431 431 { 432 432 QWidget * w; … … 439 439 box->addItem (tr ("Prefer encryption"), 1); 440 440 box->addItem (tr ("Require encryption"), 2); 441 myWidgets.insert (Prefs ::ENCRYPTION, box);441 myWidgets.insert (Prefs::ENCRYPTION, box); 442 442 connect (box, SIGNAL(activated(int)), this, SLOT(encryptionEdited(int))); 443 443 … … 477 477 478 478 void 479 PrefsDialog ::onScriptClicked (void)479 PrefsDialog::onScriptClicked (void) 480 480 { 481 481 const QString title = tr ("Select \"Torrent Done\" Script"); … … 488 488 489 489 void 490 PrefsDialog ::onIncompleteClicked (void)490 PrefsDialog::onIncompleteClicked (void) 491 491 { 492 492 const QString title = tr ("Select Incomplete Directory"); … … 499 499 500 500 void 501 PrefsDialog ::onWatchClicked (void)501 PrefsDialog::onWatchClicked (void) 502 502 { 503 503 const QString title = tr ("Select Watch Directory"); … … 510 510 511 511 void 512 PrefsDialog ::onDestinationClicked (void)512 PrefsDialog::onDestinationClicked (void) 513 513 { 514 514 const QString title = tr ("Select Destination"); … … 521 521 522 522 void 523 PrefsDialog ::onLocationSelected (const QString& path, int key)523 PrefsDialog::onLocationSelected (const QString& path, int key) 524 524 { 525 525 setPref (key, path); … … 527 527 528 528 QWidget * 529 PrefsDialog ::createSeedingTab ()530 { 531 const int iconSize (style ()->pixelMetric (QStyle ::PM_SmallIconSize));529 PrefsDialog::createSeedingTab () 530 { 531 const int iconSize (style ()->pixelMetric (QStyle::PM_SmallIconSize)); 532 532 const QFileIconProvider iconProvider; 533 533 const QIcon folderIcon = iconProvider.icon (QFileIconProvider::Folder); … … 555 555 556 556 QWidget * 557 PrefsDialog ::createDownloadingTab ()558 { 559 const int iconSize (style ()->pixelMetric (QStyle ::PM_SmallIconSize));557 PrefsDialog::createDownloadingTab () 558 { 559 const int iconSize (style ()->pixelMetric (QStyle::PM_SmallIconSize)); 560 560 const QFileIconProvider iconProvider; 561 561 const QIcon folderIcon = iconProvider.icon (QFileIconProvider::Folder); … … 631 631 ***/ 632 632 633 PrefsDialog ::PrefsDialog (Session& session, Prefs& prefs, QWidget * parent):633 PrefsDialog::PrefsDialog (Session& session, Prefs& prefs, QWidget * parent): 634 634 QDialog (parent), 635 635 myIsServer (session.isServer ()), … … 658 658 659 659 QList<int> keys; 660 keys << Prefs ::RPC_ENABLED661 << Prefs ::ALT_SPEED_LIMIT_ENABLED662 << Prefs ::ALT_SPEED_LIMIT_TIME_ENABLED663 << Prefs ::ENCRYPTION664 << Prefs ::BLOCKLIST_ENABLED665 << Prefs ::DIR_WATCH666 << Prefs ::DOWNLOAD_DIR667 << Prefs ::INCOMPLETE_DIR668 << Prefs ::INCOMPLETE_DIR_ENABLED669 << Prefs ::SCRIPT_TORRENT_DONE_FILENAME;660 keys << Prefs::RPC_ENABLED 661 << Prefs::ALT_SPEED_LIMIT_ENABLED 662 << Prefs::ALT_SPEED_LIMIT_TIME_ENABLED 663 << Prefs::ENCRYPTION 664 << Prefs::BLOCKLIST_ENABLED 665 << Prefs::DIR_WATCH 666 << Prefs::DOWNLOAD_DIR 667 << Prefs::INCOMPLETE_DIR 668 << Prefs::INCOMPLETE_DIR_ENABLED 669 << Prefs::SCRIPT_TORRENT_DONE_FILENAME; 670 670 foreach (int key, keys) 671 671 refreshPref (key); … … 683 683 } 684 684 685 PrefsDialog ::~PrefsDialog ()686 { 687 } 688 689 void 690 PrefsDialog ::setPref (int key, const QVariant& v)685 PrefsDialog::~PrefsDialog () 686 { 687 } 688 689 void 690 PrefsDialog::setPref (int key, const QVariant& v) 691 691 { 692 692 myPrefs.set (key, v); … … 699 699 700 700 void 701 PrefsDialog ::sessionUpdated ()701 PrefsDialog::sessionUpdated () 702 702 { 703 703 updateBlocklistLabel (); … … 705 705 706 706 void 707 PrefsDialog ::updateBlocklistLabel ()707 PrefsDialog::updateBlocklistLabel () 708 708 { 709 709 const int n = mySession.blocklistSize (); … … 712 712 713 713 void 714 PrefsDialog ::refreshPref (int key)714 PrefsDialog::refreshPref (int key) 715 715 { 716 716 switch (key) 717 717 { 718 case Prefs ::RPC_ENABLED:719 case Prefs ::RPC_WHITELIST_ENABLED:720 case Prefs ::RPC_AUTH_REQUIRED:718 case Prefs::RPC_ENABLED: 719 case Prefs::RPC_WHITELIST_ENABLED: 720 case Prefs::RPC_AUTH_REQUIRED: 721 721 { 722 722 const bool enabled (myPrefs.getBool (Prefs::RPC_ENABLED)); … … 729 729 } 730 730 731 case Prefs ::ALT_SPEED_LIMIT_TIME_ENABLED:731 case Prefs::ALT_SPEED_LIMIT_TIME_ENABLED: 732 732 { 733 733 const bool enabled = myPrefs.getBool (key); … … 736 736 } 737 737 738 case Prefs ::BLOCKLIST_ENABLED:738 case Prefs::BLOCKLIST_ENABLED: 739 739 { 740 740 const bool enabled = myPrefs.getBool (key); … … 743 743 } 744 744 745 case Prefs ::DIR_WATCH:745 case Prefs::DIR_WATCH: 746 746 myWatchButton->setText (QFileInfo(myPrefs.getString(Prefs::DIR_WATCH)).fileName()); 747 747 break; 748 748 749 case Prefs ::SCRIPT_TORRENT_DONE_FILENAME:749 case Prefs::SCRIPT_TORRENT_DONE_FILENAME: 750 750 { 751 751 const QString path (myPrefs.getString (key)); … … 754 754 } 755 755 756 case Prefs ::PEER_PORT:756 case Prefs::PEER_PORT: 757 757 myPortLabel->setText (tr ("Status unknown")); 758 758 myPortButton->setEnabled (true); 759 759 break; 760 760 761 case Prefs ::DOWNLOAD_DIR:761 case Prefs::DOWNLOAD_DIR: 762 762 { 763 763 const QString path (myPrefs.getString (key)); … … 767 767 } 768 768 769 case Prefs ::INCOMPLETE_DIR:769 case Prefs::INCOMPLETE_DIR: 770 770 { 771 771 QString path (myPrefs.getString (key)); … … 774 774 } 775 775 776 case Prefs ::INCOMPLETE_DIR_ENABLED:776 case Prefs::INCOMPLETE_DIR_ENABLED: 777 777 { 778 778 const bool enabled = myPrefs.getBool (key); … … 826 826 827 827 bool 828 PrefsDialog ::isAllowed (int key) const828 PrefsDialog::isAllowed (int key) const 829 829 { 830 830 Q_UNUSED (key); -
trunk/qt/prefs.cc
r14225 r14377 126 126 ***/ 127 127 128 Prefs ::Prefs (const char * configDir):128 Prefs::Prefs (const char * configDir): 129 129 myConfigDir (QString::fromUtf8 (configDir)) 130 130 { … … 188 188 case QVariant::DateTime: 189 189 if (tr_variantGetInt (b, &intVal)) 190 myValues[i].setValue (QDateTime ::fromTime_t (intVal));190 myValues[i].setValue (QDateTime::fromTime_t (intVal)); 191 191 break; 192 192 … … 200 200 } 201 201 202 Prefs ::~Prefs ()202 Prefs::~Prefs () 203 203 { 204 204 // make a dict from settings.json … … 274 274 */ 275 275 void 276 Prefs ::initDefaults (tr_variant * d)276 Prefs::initDefaults (tr_variant * d) 277 277 { 278 278 tr_variantDictReserve (d, 38); … … 322 322 323 323 bool 324 Prefs ::getBool (int key) const324 Prefs::getBool (int key) const 325 325 { 326 326 assert (myItems[key].type == QVariant::Bool); … … 329 329 330 330 QString 331 Prefs ::getString (int key) const331 Prefs::getString (int key) const 332 332 { 333 333 assert (myItems[key].type == QVariant::String); … … 339 339 340 340 int 341 Prefs ::getInt (int key) const341 Prefs::getInt (int key) const 342 342 { 343 343 assert (myItems[key].type == QVariant::Int); … … 346 346 347 347 double 348 Prefs ::getDouble (int key) const348 Prefs::getDouble (int key) const 349 349 { 350 350 assert (myItems[key].type == QVariant::Double); … … 353 353 354 354 QDateTime 355 Prefs ::getDateTime (int key) const355 Prefs::getDateTime (int key) const 356 356 { 357 357 assert (myItems[key].type == QVariant::DateTime); … … 364 364 365 365 void 366 Prefs ::toggleBool (int key)366 Prefs::toggleBool (int key) 367 367 { 368 368 set (key, !getBool(key)); -
trunk/qt/relocate.cc
r14225 r14377 27 27 #include "utils.h" 28 28 29 bool RelocateDialog ::myMoveFlag = true;29 bool RelocateDialog::myMoveFlag = true; 30 30 31 31 void 32 RelocateDialog ::onSetLocation ()32 RelocateDialog::onSetLocation () 33 33 { 34 34 mySession.torrentSetLocation (myIds, myPath, myMoveFlag); … … 37 37 38 38 void 39 RelocateDialog ::onFileSelected (const QString& path)39 RelocateDialog::onFileSelected (const QString& path) 40 40 { 41 41 myPath = path; … … 44 44 45 45 void 46 RelocateDialog ::onDirButtonClicked ()46 RelocateDialog::onDirButtonClicked () 47 47 { 48 48 const QString title = tr ("Select Location"); … … 54 54 55 55 void 56 RelocateDialog ::onMoveToggled (bool b)56 RelocateDialog::onMoveToggled (bool b) 57 57 { 58 58 myMoveFlag = b; 59 59 } 60 60 61 RelocateDialog ::RelocateDialog (Session & session,62 63 64 61 RelocateDialog::RelocateDialog (Session & session, 62 TorrentModel & model, 63 const QSet<int> & ids, 64 QWidget * parent): 65 65 QDialog (parent), 66 66 mySession (session), … … 68 68 myIds (ids) 69 69 { 70 const int iconSize (style ()->pixelMetric (QStyle ::PM_SmallIconSize));70 const int iconSize (style ()->pixelMetric (QStyle::PM_SmallIconSize)); 71 71 const QFileIconProvider iconProvider; 72 72 const QIcon folderIcon = iconProvider.icon (QFileIconProvider::Folder); -
trunk/qt/session-dialog.cc
r14225 r14377 26 26 27 27 void 28 SessionDialog ::onAccepted ()28 SessionDialog::onAccepted () 29 29 { 30 30 myPrefs.set (Prefs::SESSION_IS_REMOTE, myRemoteRadioButton->isChecked ()); … … 39 39 40 40 void 41 SessionDialog ::resensitize ()41 SessionDialog::resensitize () 42 42 { 43 43 const bool isRemote = myRemoteRadioButton->isChecked(); … … 55 55 ***/ 56 56 57 SessionDialog ::SessionDialog (Session& session, Prefs& prefs, QWidget * parent):57 SessionDialog::SessionDialog (Session& session, Prefs& prefs, QWidget * parent): 58 58 QDialog (parent), 59 59 mySession (session), … … 68 68 setWindowTitle (tr ("Change Session")); 69 69 QVBoxLayout * top = new QVBoxLayout (this); 70 top->setSpacing (HIG ::PAD);70 top->setSpacing (HIG::PAD); 71 71 72 72 HIG * hig = new HIG; -
trunk/qt/session.cc
r14349 r14377 90 90 91 91 void 92 FileAdded ::executed (int64_t tag, const QString& result, struct tr_variant * arguments)92 FileAdded::executed (int64_t tag, const QString& result, struct tr_variant * arguments) 93 93 { 94 94 Q_UNUSED (arguments); … … 127 127 128 128 void 129 Session ::sessionSet (const tr_quark key, const QVariant& value)129 Session::sessionSet (const tr_quark key, const QVariant& value) 130 130 { 131 131 tr_variant top; … … 146 146 147 147 void 148 Session ::portTest ()148 Session::portTest () 149 149 { 150 150 tr_variant top; … … 157 157 158 158 void 159 Session ::copyMagnetLinkToClipboard (int torrentId)159 Session::copyMagnetLinkToClipboard (int torrentId) 160 160 { 161 161 tr_variant top; … … 171 171 172 172 void 173 Session ::updatePref (int key)173 Session::updatePref (int key) 174 174 { 175 175 if (myPrefs.isCore (key)) switch (key) 176 176 { 177 case Prefs ::ALT_SPEED_LIMIT_DOWN:178 case Prefs ::ALT_SPEED_LIMIT_ENABLED:179 case Prefs ::ALT_SPEED_LIMIT_TIME_BEGIN:180 case Prefs ::ALT_SPEED_LIMIT_TIME_DAY:181 case Prefs ::ALT_SPEED_LIMIT_TIME_ENABLED:182 case Prefs ::ALT_SPEED_LIMIT_TIME_END:183 case Prefs ::ALT_SPEED_LIMIT_UP:184 case Prefs ::BLOCKLIST_DATE:185 case Prefs ::BLOCKLIST_ENABLED:186 case Prefs ::BLOCKLIST_URL:187 case Prefs ::DHT_ENABLED:188 case Prefs ::DOWNLOAD_QUEUE_ENABLED:189 case Prefs ::DOWNLOAD_QUEUE_SIZE:190 case Prefs ::DSPEED:191 case Prefs ::DSPEED_ENABLED:192 case Prefs ::IDLE_LIMIT:193 case Prefs ::IDLE_LIMIT_ENABLED:194 case Prefs ::INCOMPLETE_DIR:195 case Prefs ::INCOMPLETE_DIR_ENABLED:196 case Prefs ::LPD_ENABLED:197 case Prefs ::PEER_LIMIT_GLOBAL:198 case Prefs ::PEER_LIMIT_TORRENT:199 case Prefs ::PEER_PORT:200 case Prefs ::PEER_PORT_RANDOM_ON_START:201 case Prefs ::QUEUE_STALLED_MINUTES:202 case Prefs ::PEX_ENABLED:203 case Prefs ::PORT_FORWARDING:204 case Prefs ::RENAME_PARTIAL_FILES:205 case Prefs ::SCRIPT_TORRENT_DONE_ENABLED:206 case Prefs ::SCRIPT_TORRENT_DONE_FILENAME:207 case Prefs ::START:208 case Prefs ::TRASH_ORIGINAL:209 case Prefs ::USPEED:210 case Prefs ::USPEED_ENABLED:211 case Prefs ::UTP_ENABLED:177 case Prefs::ALT_SPEED_LIMIT_DOWN: 178 case Prefs::ALT_SPEED_LIMIT_ENABLED: 179 case Prefs::ALT_SPEED_LIMIT_TIME_BEGIN: 180 case Prefs::ALT_SPEED_LIMIT_TIME_DAY: 181 case Prefs::ALT_SPEED_LIMIT_TIME_ENABLED: 182 case Prefs::ALT_SPEED_LIMIT_TIME_END: 183 case Prefs::ALT_SPEED_LIMIT_UP: 184 case Prefs::BLOCKLIST_DATE: 185 case Prefs::BLOCKLIST_ENABLED: 186 case Prefs::BLOCKLIST_URL: 187 case Prefs::DHT_ENABLED: 188 case Prefs::DOWNLOAD_QUEUE_ENABLED: 189 case Prefs::DOWNLOAD_QUEUE_SIZE: 190 case Prefs::DSPEED: 191 case Prefs::DSPEED_ENABLED: 192 case Prefs::IDLE_LIMIT: 193 case Prefs::IDLE_LIMIT_ENABLED: 194 case Prefs::INCOMPLETE_DIR: 195 case Prefs::INCOMPLETE_DIR_ENABLED: 196 case Prefs::LPD_ENABLED: 197 case Prefs::PEER_LIMIT_GLOBAL: 198 case Prefs::PEER_LIMIT_TORRENT: 199 case Prefs::PEER_PORT: 200 case Prefs::PEER_PORT_RANDOM_ON_START: 201 case Prefs::QUEUE_STALLED_MINUTES: 202 case Prefs::PEX_ENABLED: 203 case Prefs::PORT_FORWARDING: 204 case Prefs::RENAME_PARTIAL_FILES: 205 case Prefs::SCRIPT_TORRENT_DONE_ENABLED: 206 case Prefs::SCRIPT_TORRENT_DONE_FILENAME: 207 case Prefs::START: 208 case Prefs::TRASH_ORIGINAL: 209 case Prefs::USPEED: 210 case Prefs::USPEED_ENABLED: 211 case Prefs::UTP_ENABLED: 212 212 sessionSet (myPrefs.getKey (key), myPrefs.variant (key)); 213 213 break; 214 214 215 case Prefs ::DOWNLOAD_DIR:215 case Prefs::DOWNLOAD_DIR: 216 216 sessionSet (myPrefs.getKey (key), myPrefs.variant (key)); 217 217 /* this will change the 'freespace' argument, so refresh */ … … 219 219 break; 220 220 221 case Prefs ::RATIO:221 case Prefs::RATIO: 222 222 sessionSet (TR_KEY_seedRatioLimit, myPrefs.variant (key)); 223 223 break; 224 case Prefs ::RATIO_ENABLED:224 case Prefs::RATIO_ENABLED: 225 225 sessionSet (TR_KEY_seedRatioLimited, myPrefs.variant (key)); 226 226 break; 227 227 228 case Prefs ::ENCRYPTION:228 case Prefs::ENCRYPTION: 229 229 { 230 230 const int i = myPrefs.variant (key).toInt (); … … 244 244 } 245 245 246 case Prefs ::RPC_AUTH_REQUIRED:246 case Prefs::RPC_AUTH_REQUIRED: 247 247 if (mySession) 248 248 tr_sessionSetRPCPasswordEnabled (mySession, myPrefs.getBool (key)); 249 249 break; 250 250 251 case Prefs ::RPC_ENABLED:251 case Prefs::RPC_ENABLED: 252 252 if (mySession) 253 253 tr_sessionSetRPCEnabled (mySession, myPrefs.getBool (key)); 254 254 break; 255 255 256 case Prefs ::RPC_PASSWORD:256 case Prefs::RPC_PASSWORD: 257 257 if (mySession) 258 258 tr_sessionSetRPCPassword (mySession, myPrefs.getString (key).toUtf8 ().constData ()); 259 259 break; 260 260 261 case Prefs ::RPC_PORT:261 case Prefs::RPC_PORT: 262 262 if (mySession) 263 263 tr_sessionSetRPCPort (mySession, myPrefs.getInt (key)); 264 264 break; 265 265 266 case Prefs ::RPC_USERNAME:266 case Prefs::RPC_USERNAME: 267 267 if (mySession) 268 268 tr_sessionSetRPCUsername (mySession, myPrefs.getString (key).toUtf8 ().constData ()); 269 269 break; 270 270 271 case Prefs ::RPC_WHITELIST_ENABLED:271 case Prefs::RPC_WHITELIST_ENABLED: 272 272 if (mySession) 273 273 tr_sessionSetRPCWhitelistEnabled (mySession, myPrefs.getBool (key)); 274 274 break; 275 275 276 case Prefs ::RPC_WHITELIST:276 case Prefs::RPC_WHITELIST: 277 277 if (mySession) 278 278 tr_sessionSetRPCWhitelist (mySession, myPrefs.getString (key).toUtf8 ().constData ()); … … 288 288 ***/ 289 289 290 Session ::Session (const char * configDir, Prefs& prefs):290 Session::Session (const char * configDir, Prefs& prefs): 291 291 nextUniqueTag (FIRST_UNIQUE_TAG), 292 292 myBlocklistSize (-1), … … 310 310 } 311 311 312 Session ::~Session ()312 Session::~Session () 313 313 { 314 314 stop (); … … 316 316 317 317 QNetworkAccessManager * 318 Session ::networkAccessManager ()318 Session::networkAccessManager () 319 319 { 320 320 if (myNAM == 0) … … 337 337 338 338 void 339 Session ::stop ()339 Session::stop () 340 340 { 341 341 if (myNAM != 0) … … 355 355 356 356 void 357 Session ::restart ()357 Session::restart () 358 358 { 359 359 stop (); … … 362 362 363 363 void 364 Session ::start ()364 Session::start () 365 365 { 366 366 if (myPrefs.get<bool> (Prefs::SESSION_IS_REMOTE)) … … 397 397 398 398 bool 399 Session ::isServer () const399 Session::isServer () const 400 400 { 401 401 return mySession != 0; … … 403 403 404 404 bool 405 Session ::isLocal () const405 Session::isLocal () const 406 406 { 407 407 if (mySession != 0) … … 448 448 449 449 void 450 Session ::torrentSet (const QSet<int>& ids, const tr_quark key, double value)450 Session::torrentSet (const QSet<int>& ids, const tr_quark key, double value) 451 451 { 452 452 tr_variant top; … … 461 461 462 462 void 463 Session ::torrentSet (const QSet<int>& ids, const tr_quark key, int value)463 Session::torrentSet (const QSet<int>& ids, const tr_quark key, int value) 464 464 { 465 465 tr_variant top; … … 474 474 475 475 void 476 Session ::torrentSet (const QSet<int>& ids, const tr_quark key, bool value)476 Session::torrentSet (const QSet<int>& ids, const tr_quark key, bool value) 477 477 { 478 478 tr_variant top; … … 487 487 488 488 void 489 Session ::torrentSet (const QSet<int>& ids, const tr_quark key, const QStringList& value)489 Session::torrentSet (const QSet<int>& ids, const tr_quark key, const QStringList& value) 490 490 { 491 491 tr_variant top; … … 502 502 503 503 void 504 Session ::torrentSet (const QSet<int>& ids, const tr_quark key, const QList<int>& value)504 Session::torrentSet (const QSet<int>& ids, const tr_quark key, const QList<int>& value) 505 505 { 506 506 tr_variant top; … … 517 517 518 518 void 519 Session ::torrentSet (const QSet<int>& ids, const tr_quark key, const QPair<int,QString>& value)519 Session::torrentSet (const QSet<int>& ids, const tr_quark key, const QPair<int,QString>& value) 520 520 { 521 521 tr_variant top; … … 532 532 533 533 void 534 Session ::torrentSetLocation (const QSet<int>& ids, const QString& location, bool doMove)534 Session::torrentSetLocation (const QSet<int>& ids, const QString& location, bool doMove) 535 535 { 536 536 tr_variant top; … … 546 546 547 547 void 548 Session ::torrentRenamePath (const QSet<int>& ids, const QString& oldpath, const QString& newname)548 Session::torrentRenamePath (const QSet<int>& ids, const QString& oldpath, const QString& newname) 549 549 { 550 550 tr_variant top; … … 561 561 562 562 void 563 Session ::refreshTorrents (const QSet<int>& ids)563 Session::refreshTorrents (const QSet<int>& ids) 564 564 { 565 565 if (ids.empty ()) … … 582 582 583 583 void 584 Session ::refreshExtraStats (const QSet<int>& ids)584 Session::refreshExtraStats (const QSet<int>& ids) 585 585 { 586 586 tr_variant top; … … 596 596 597 597 void 598 Session ::sendTorrentRequest (const char * request, const QSet<int>& ids)598 Session::sendTorrentRequest (const char * request, const QSet<int>& ids) 599 599 { 600 600 tr_variant top; … … 608 608 } 609 609 610 void Session ::pauseTorrents (const QSet<int>& ids) { sendTorrentRequest ("torrent-stop", ids); }611 void Session ::startTorrents (const QSet<int>& ids) { sendTorrentRequest ("torrent-start", ids); }612 void Session ::startTorrentsNow (const QSet<int>& ids) { sendTorrentRequest ("torrent-start-now", ids); }613 void Session ::queueMoveTop (const QSet<int>& ids) { sendTorrentRequest ("queue-move-top", ids); }614 void Session ::queueMoveUp (const QSet<int>& ids) { sendTorrentRequest ("queue-move-up", ids); }615 void Session ::queueMoveDown (const QSet<int>& ids) { sendTorrentRequest ("queue-move-down", ids); }616 void Session ::queueMoveBottom (const QSet<int>& ids) { sendTorrentRequest ("queue-move-bottom", ids); }617 618 void 619 Session ::refreshActiveTorrents ()610 void Session::pauseTorrents (const QSet<int>& ids) { sendTorrentRequest ("torrent-stop", ids); } 611 void Session::startTorrents (const QSet<int>& ids) { sendTorrentRequest ("torrent-start", ids); } 612 void Session::startTorrentsNow (const QSet<int>& ids) { sendTorrentRequest ("torrent-start-now", ids); } 613 void Session::queueMoveTop (const QSet<int>& ids) { sendTorrentRequest ("queue-move-top", ids); } 614 void Session::queueMoveUp (const QSet<int>& ids) { sendTorrentRequest ("queue-move-up", ids); } 615 void Session::queueMoveDown (const QSet<int>& ids) { sendTorrentRequest ("queue-move-down", ids); } 616 void Session::queueMoveBottom (const QSet<int>& ids) { sendTorrentRequest ("queue-move-bottom", ids); } 617 618 void 619 Session::refreshActiveTorrents () 620 620 { 621 621 tr_variant top; … … 631 631 632 632 void 633 Session ::refreshAllTorrents ()633 Session::refreshAllTorrents () 634 634 { 635 635 tr_variant top; … … 644 644 645 645 void 646 Session ::initTorrents (const QSet<int>& ids)646 Session::initTorrents (const QSet<int>& ids) 647 647 { 648 648 tr_variant top; … … 656 656 657 657 void 658 Session ::refreshSessionStats ()658 Session::refreshSessionStats () 659 659 { 660 660 tr_variant top; … … 667 667 668 668 void 669 Session ::refreshSessionInfo ()669 Session::refreshSessionInfo () 670 670 { 671 671 tr_variant top; … … 678 678 679 679 void 680 Session ::updateBlocklist ()680 Session::updateBlocklist () 681 681 { 682 682 tr_variant top; … … 693 693 694 694 void 695 Session ::exec (const tr_variant * request)695 Session::exec (const tr_variant * request) 696 696 { 697 697 char * str = tr_variantToStr (request, TR_VARIANT_FMT_JSON_LEAN, NULL); … … 701 701 702 702 void 703 Session ::localSessionCallback (tr_session * s, struct evbuffer * json, void * vself)703 Session::localSessionCallback (tr_session * s, struct evbuffer * json, void * vself) 704 704 { 705 705 Q_UNUSED (s); … … 716 716 717 717 void 718 Session ::exec (const char * json)718 Session::exec (const char * json) 719 719 { 720 720 if (mySession ) … … 752 752 753 753 void 754 Session ::onFinished (QNetworkReply * reply)754 Session::onFinished (QNetworkReply * reply) 755 755 { 756 756 #ifdef DEBUG_HTTP … … 790 790 791 791 void 792 Session ::onResponseReceived (const QByteArray& utf8)792 Session::onResponseReceived (const QByteArray& utf8) 793 793 { 794 794 parseResponse (utf8.constData (), utf8.length ()); … … 796 796 797 797 void 798 Session ::parseResponse (const char * json, size_t jsonLength)798 Session::parseResponse (const char * json, size_t jsonLength) 799 799 { 800 800 tr_variant top; … … 921 921 922 922 void 923 Session ::updateStats (tr_variant * d, struct tr_session_stats * stats)923 Session::updateStats (tr_variant * d, struct tr_session_stats * stats) 924 924 { 925 925 int64_t i; … … 940 940 941 941 void 942 Session ::updateStats (tr_variant * d)942 Session::updateStats (tr_variant * d) 943 943 { 944 944 tr_variant * c; … … 954 954 955 955 void 956 Session ::updateInfo (tr_variant * d)956 Session::updateInfo (tr_variant * d) 957 957 { 958 958 int64_t i; … … 968 968 continue; 969 969 970 if (i == Prefs ::ENCRYPTION)970 if (i == Prefs::ENCRYPTION) 971 971 { 972 972 const char * val; … … 985 985 switch (myPrefs.type (i)) 986 986 { 987 case QVariant ::Int:987 case QVariant::Int: 988 988 { 989 989 int64_t val; … … 992 992 break; 993 993 } 994 case QVariant ::Double:994 case QVariant::Double: 995 995 { 996 996 double val; … … 999 999 break; 1000 1000 } 1001 case QVariant ::Bool:1001 case QVariant::Bool: 1002 1002 { 1003 1003 bool val; … … 1006 1006 break; 1007 1007 } 1008 case TrTypes ::FilterModeType:1009 case TrTypes ::SortModeType:1010 case QVariant ::String:1008 case TrTypes::FilterModeType: 1009 case TrTypes::SortModeType: 1010 case QVariant::String: 1011 1011 { 1012 1012 const char * val; … … 1045 1045 mySessionVersion = str; 1046 1046 1047 //std::cerr << "Session ::updateInfo end" << std::endl;1047 //std::cerr << "Session::updateInfo end" << std::endl; 1048 1048 connect (&myPrefs, SIGNAL (changed (int)), this, SLOT (updatePref (int))); 1049 1049 … … 1052 1052 1053 1053 void 1054 Session ::setBlocklistSize (int64_t i)1054 Session::setBlocklistSize (int64_t i) 1055 1055 { 1056 1056 myBlocklistSize = i; … … 1060 1060 1061 1061 void 1062 Session ::addTorrent (const AddData& addMe, tr_variant& top, bool trashOriginal)1062 Session::addTorrent (const AddData& addMe, tr_variant& top, bool trashOriginal) 1063 1063 { 1064 1064 assert (tr_variantDictFind (&top, TR_KEY_method) == nullptr); … … 1114 1114 1115 1115 void 1116 Session ::addTorrent (const AddData& addMe)1116 Session::addTorrent (const AddData& addMe) 1117 1117 { 1118 1118 tr_variant top; … … 1125 1125 1126 1126 void 1127 Session ::addNewlyCreatedTorrent (const QString& filename, const QString& localPath)1127 Session::addNewlyCreatedTorrent (const QString& filename, const QString& localPath) 1128 1128 { 1129 1129 const QByteArray b64 = AddData (filename).toBase64 (); … … 1142 1142 1143 1143 void 1144 Session ::removeTorrents (const QSet<int>& ids, bool deleteFiles)1144 Session::removeTorrents (const QSet<int>& ids, bool deleteFiles) 1145 1145 { 1146 1146 if (!ids.isEmpty ()) … … 1158 1158 1159 1159 void 1160 Session ::verifyTorrents (const QSet<int>& ids)1160 Session::verifyTorrents (const QSet<int>& ids) 1161 1161 { 1162 1162 if (!ids.isEmpty ()) … … 1173 1173 1174 1174 void 1175 Session ::reannounceTorrents (const QSet<int>& ids)1175 Session::reannounceTorrents (const QSet<int>& ids) 1176 1176 { 1177 1177 if (!ids.isEmpty ()) … … 1192 1192 1193 1193 void 1194 Session ::launchWebInterface ()1194 Session::launchWebInterface () 1195 1195 { 1196 1196 QUrl url; … … 1208 1208 } 1209 1209 1210 QDesktopServices ::openUrl (url);1211 } 1210 QDesktopServices::openUrl (url); 1211 } -
trunk/qt/squeezelabel.cc
r14204 r14377 48 48 49 49 void 50 SqueezeLabel ::init ()50 SqueezeLabel::init () 51 51 { 52 52 setTextInteractionFlags(Qt::TextSelectableByMouse); 53 53 } 54 54 55 SqueezeLabel :: SqueezeLabel (const QString& text, QWidget *parent):55 SqueezeLabel::SqueezeLabel (const QString& text, QWidget * parent): 56 56 QLabel (text, parent) 57 57 { … … 59 59 } 60 60 61 SqueezeLabel ::SqueezeLabel (QWidget * parent):61 SqueezeLabel::SqueezeLabel (QWidget * parent): 62 62 QLabel (parent) 63 63 { … … 66 66 67 67 void 68 SqueezeLabel ::paintEvent (QPaintEvent * paintEvent)68 SqueezeLabel::paintEvent (QPaintEvent * paintEvent) 69 69 { 70 70 Q_UNUSED (paintEvent); -
trunk/qt/stats-dialog.cc
r14225 r14377 23 23 }; 24 24 25 StatsDialog :: StatsDialog (Session& session, QWidget * parent):25 StatsDialog::StatsDialog (Session& session, QWidget * parent): 26 26 QDialog (parent, Qt::Dialog), 27 27 mySession (session), … … 58 58 } 59 59 60 StatsDialog ::~StatsDialog ()60 StatsDialog::~StatsDialog () 61 61 { 62 62 } 63 63 64 64 void 65 StatsDialog ::setVisible (bool visible)65 StatsDialog::setVisible (bool visible) 66 66 { 67 67 myTimer->stop (); … … 72 72 73 73 void 74 StatsDialog ::onTimer ()74 StatsDialog::onTimer () 75 75 { 76 76 mySession.refreshSessionStats (); … … 78 78 79 79 void 80 StatsDialog ::updateStats ()80 StatsDialog::updateStats () 81 81 { 82 82 const struct tr_session_stats& current (mySession.getStats ()); -
trunk/qt/torrent-delegate-min.cc
r14225 r14377 45 45 46 46 QSize 47 TorrentDelegateMin ::sizeHint (const QStyleOptionViewItem & option,48 47 TorrentDelegateMin::sizeHint (const QStyleOptionViewItem & option, 48 const Torrent & tor) const 49 49 { 50 50 const QStyle* style (QApplication::style()); 51 static const int iconSize (style->pixelMetric (QStyle ::PM_SmallIconSize));51 static const int iconSize (style->pixelMetric (QStyle::PM_SmallIconSize)); 52 52 53 53 QFont nameFont (option.font); … … 72 72 73 73 void 74 TorrentDelegateMin ::drawTorrent (QPainter * painter,75 76 74 TorrentDelegateMin::drawTorrent (QPainter * painter, 75 const QStyleOptionViewItem & option, 76 const Torrent & tor) const 77 77 { 78 78 const bool isPaused (tor.isPaused()); 79 79 const QStyle * style (QApplication::style()); 80 static const int iconSize (style->pixelMetric (QStyle ::PM_SmallIconSize));80 static const int iconSize (style->pixelMetric (QStyle::PM_SmallIconSize)); 81 81 82 82 QFont nameFont (option.font); -
trunk/qt/torrent-delegate.cc
r14225 r14377 32 32 }; 33 33 34 QColor TorrentDelegate ::greenBrush;35 QColor TorrentDelegate ::blueBrush;36 QColor TorrentDelegate ::silverBrush;37 QColor TorrentDelegate ::greenBack;38 QColor TorrentDelegate ::blueBack;39 QColor TorrentDelegate ::silverBack;40 41 TorrentDelegate ::TorrentDelegate (QObject * parent):34 QColor TorrentDelegate::greenBrush; 35 QColor TorrentDelegate::blueBrush; 36 QColor TorrentDelegate::silverBrush; 37 QColor TorrentDelegate::greenBack; 38 QColor TorrentDelegate::blueBack; 39 QColor TorrentDelegate::silverBack; 40 41 TorrentDelegate::TorrentDelegate (QObject * parent): 42 42 QStyledItemDelegate (parent), 43 43 myProgressBarStyle (new QStyleOptionProgressBar) … … 56 56 } 57 57 58 TorrentDelegate ::~TorrentDelegate ()58 TorrentDelegate::~TorrentDelegate () 59 59 { 60 60 delete myProgressBarStyle; … … 66 66 67 67 QSize 68 TorrentDelegate ::margin (const QStyle& style) const68 TorrentDelegate::margin (const QStyle& style) const 69 69 { 70 70 Q_UNUSED (style); … … 74 74 75 75 QString 76 TorrentDelegate ::progressString (const Torrent& tor) const76 TorrentDelegate::progressString (const Torrent& tor) const 77 77 { 78 78 const bool isMagnet (!tor.hasMetadata()); … … 173 173 174 174 QString 175 TorrentDelegate ::shortTransferString (const Torrent& tor) const175 TorrentDelegate::shortTransferString (const Torrent& tor) const 176 176 { 177 177 QString str; … … 192 192 193 193 QString 194 TorrentDelegate ::shortStatusString (const Torrent& tor) const194 TorrentDelegate::shortStatusString (const Torrent& tor) const 195 195 { 196 196 QString str; … … 220 220 221 221 QString 222 TorrentDelegate ::statusString (const Torrent& tor) const222 TorrentDelegate::statusString (const Torrent& tor) const 223 223 { 224 224 QString str; … … 289 289 290 290 QSize 291 TorrentDelegate ::sizeHint (const QStyleOptionViewItem& option, const Torrent& tor) const291 TorrentDelegate::sizeHint (const QStyleOptionViewItem& option, const Torrent& tor) const 292 292 { 293 293 const QStyle* style (QApplication::style ()); … … 315 315 316 316 QSize 317 TorrentDelegate ::sizeHint (const QStyleOptionViewItem & option,318 317 TorrentDelegate::sizeHint (const QStyleOptionViewItem & option, 318 const QModelIndex & index) const 319 319 { 320 320 const Torrent * tor (index.data (TorrentModel::TorrentRole).value<const Torrent*>()); … … 323 323 324 324 void 325 TorrentDelegate ::paint (QPainter * painter,326 327 325 TorrentDelegate::paint (QPainter * painter, 326 const QStyleOptionViewItem & option, 327 const QModelIndex & index) const 328 328 { 329 329 const Torrent * tor (index.data (TorrentModel::TorrentRole).value<const Torrent*>()); … … 335 335 336 336 void 337 TorrentDelegate ::setProgressBarPercentDone (const QStyleOptionViewItem & option,338 337 TorrentDelegate::setProgressBarPercentDone (const QStyleOptionViewItem & option, 338 const Torrent & tor) const 339 339 { 340 340 double seedRatioLimit; … … 354 354 355 355 void 356 TorrentDelegate ::drawTorrent (QPainter * painter,357 358 356 TorrentDelegate::drawTorrent (QPainter * painter, 357 const QStyleOptionViewItem & option, 358 const Torrent & tor) const 359 359 { 360 360 const QStyle * style (QApplication::style ()); -
trunk/qt/torrent-filter.cc
r14225 r14377 19 19 #include "utils.h" 20 20 21 TorrentFilter ::TorrentFilter (Prefs& prefs):21 TorrentFilter::TorrentFilter (Prefs& prefs): 22 22 myPrefs (prefs) 23 23 { … … 29 29 // initialize our state from the current prefs 30 30 QList<int> initKeys; 31 initKeys << Prefs ::SORT_MODE32 << Prefs ::FILTER_MODE33 << Prefs ::FILTER_TRACKERS34 << Prefs ::FILTER_TEXT;31 initKeys << Prefs::SORT_MODE 32 << Prefs::FILTER_MODE 33 << Prefs::FILTER_TRACKERS 34 << Prefs::FILTER_TEXT; 35 35 foreach (int key, initKeys) 36 36 refreshPref (key); 37 37 } 38 38 39 TorrentFilter ::~TorrentFilter ()39 TorrentFilter::~TorrentFilter () 40 40 { 41 41 } 42 42 43 43 void 44 TorrentFilter ::refreshPref (int key)44 TorrentFilter::refreshPref (int key) 45 45 { 46 46 switch (key) 47 47 { 48 case Prefs ::FILTER_TEXT:49 case Prefs ::FILTER_MODE:50 case Prefs ::FILTER_TRACKERS:48 case Prefs::FILTER_TEXT: 49 case Prefs::FILTER_MODE: 50 case Prefs::FILTER_TRACKERS: 51 51 invalidateFilter (); 52 52 /* force a re-sort */ 53 53 sort (0, !myPrefs.getBool(Prefs::SORT_REVERSED) ? Qt::AscendingOrder : Qt::DescendingOrder); 54 54 55 case Prefs ::SORT_MODE:56 case Prefs ::SORT_REVERSED:55 case Prefs::SORT_MODE: 56 case Prefs::SORT_REVERSED: 57 57 sort (0, myPrefs.getBool(Prefs::SORT_REVERSED) ? Qt::AscendingOrder : Qt::DescendingOrder); 58 58 invalidate (); … … 80 80 81 81 bool 82 TorrentFilter ::lessThan (const QModelIndex& left, const QModelIndex& right) const82 TorrentFilter::lessThan (const QModelIndex& left, const QModelIndex& right) const 83 83 { 84 84 int val = 0; … … 88 88 switch (myPrefs.get<SortMode>(Prefs::SORT_MODE).mode()) 89 89 { 90 case SortMode ::SORT_BY_QUEUE:90 case SortMode::SORT_BY_QUEUE: 91 91 if (!val) 92 92 val = -compare (a->queuePosition(), b->queuePosition()); 93 93 break; 94 94 95 case SortMode ::SORT_BY_SIZE:95 case SortMode::SORT_BY_SIZE: 96 96 if (!val) 97 97 val = compare (a->sizeWhenDone(), b->sizeWhenDone()); 98 98 break; 99 99 100 case SortMode ::SORT_BY_AGE:100 case SortMode::SORT_BY_AGE: 101 101 val = compare (a->dateAdded().toTime_t(), b->dateAdded().toTime_t()); 102 102 break; 103 103 104 case SortMode ::SORT_BY_ID:104 case SortMode::SORT_BY_ID: 105 105 if (!val) 106 106 val = compare (a->id(), b->id()); 107 107 break; 108 108 109 case SortMode ::SORT_BY_ACTIVITY:109 case SortMode::SORT_BY_ACTIVITY: 110 110 if (!val) 111 111 val = compare (a->downloadSpeed() + a->uploadSpeed(), b->downloadSpeed() + b->uploadSpeed()); … … 115 115 // fall through 116 116 117 case SortMode ::SORT_BY_STATE:117 case SortMode::SORT_BY_STATE: 118 118 if (!val) 119 119 val = -compare (a->isPaused(), b->isPaused()); … … 126 126 // fall through 127 127 128 case SortMode ::SORT_BY_PROGRESS:128 case SortMode::SORT_BY_PROGRESS: 129 129 if (!val) 130 130 val = compare (a->percentComplete(), b->percentComplete()); … … 134 134 val = -compare (a->queuePosition(), b->queuePosition()); 135 135 136 case SortMode ::SORT_BY_RATIO:136 case SortMode::SORT_BY_RATIO: 137 137 if (!val) 138 138 val = a->compareRatio (*b); 139 139 break; 140 140 141 case SortMode ::SORT_BY_ETA:141 case SortMode::SORT_BY_ETA: 142 142 if (!val) 143 143 val = a->compareETA (*b); … … 163 163 164 164 bool 165 TorrentFilter ::trackerFilterAcceptsTorrent (const Torrent * tor, const QString& tracker) const165 TorrentFilter::trackerFilterAcceptsTorrent (const Torrent * tor, const QString& tracker) const 166 166 { 167 167 return tracker.isEmpty() || tor->hasTrackerSubstring (tracker); … … 169 169 170 170 bool 171 TorrentFilter ::activityFilterAcceptsTorrent (const Torrent * tor, const FilterMode& m) const171 TorrentFilter::activityFilterAcceptsTorrent (const Torrent * tor, const FilterMode& m) const 172 172 { 173 173 bool accepts; … … 212 212 213 213 bool 214 TorrentFilter ::filterAcceptsRow (int sourceRow, const QModelIndex& sourceParent) const214 TorrentFilter::filterAcceptsRow (int sourceRow, const QModelIndex& sourceParent) const 215 215 { 216 216 QModelIndex childIndex = sourceModel()->index (sourceRow, 0, sourceParent); … … 241 241 242 242 int 243 TorrentFilter ::hiddenRowCount () const243 TorrentFilter::hiddenRowCount () const 244 244 { 245 245 return sourceModel()->rowCount () - rowCount (); … … 247 247 248 248 void 249 TorrentFilter ::countTorrentsPerMode (int * setmeCounts) const249 TorrentFilter::countTorrentsPerMode (int * setmeCounts) const 250 250 { 251 251 std::fill_n (setmeCounts, static_cast<std::size_t>(FilterMode::NUM_MODES), 0); -
trunk/qt/torrent-model.cc
r14225 r14377 18 18 19 19 void 20 TorrentModel ::clear ()20 TorrentModel::clear () 21 21 { 22 22 beginResetModel (); … … 31 31 32 32 int 33 TorrentModel ::rowCount (const QModelIndex& parent) const33 TorrentModel::rowCount (const QModelIndex& parent) const 34 34 { 35 35 Q_UNUSED (parent); … … 39 39 40 40 QVariant 41 TorrentModel ::data (const QModelIndex& index, int role) const41 TorrentModel::data (const QModelIndex& index, int role) const 42 42 { 43 43 QVariant var; … … 74 74 75 75 void 76 TorrentModel ::addTorrent (Torrent * t)76 TorrentModel::addTorrent (Torrent * t) 77 77 { 78 78 myIdToTorrent.insert (t->id (), t); … … 81 81 } 82 82 83 TorrentModel ::TorrentModel (Prefs& prefs):83 TorrentModel::TorrentModel (Prefs& prefs): 84 84 myPrefs (prefs) 85 85 { 86 86 } 87 87 88 TorrentModel ::~TorrentModel ()88 TorrentModel::~TorrentModel () 89 89 { 90 90 clear (); … … 96 96 97 97 Torrent* 98 TorrentModel ::getTorrentFromId (int id)98 TorrentModel::getTorrentFromId (int id) 99 99 { 100 100 id_to_torrent_t::iterator it (myIdToTorrent.find (id)); … … 103 103 104 104 const Torrent* 105 TorrentModel ::getTorrentFromId (int id) const105 TorrentModel::getTorrentFromId (int id) const 106 106 { 107 107 id_to_torrent_t::const_iterator it (myIdToTorrent.find (id)); … … 114 114 115 115 void 116 TorrentModel ::onTorrentChanged (int torrentId)116 TorrentModel::onTorrentChanged (int torrentId) 117 117 { 118 118 const int row (myIdToRow.value (torrentId, -1)); … … 125 125 126 126 void 127 TorrentModel ::removeTorrents (tr_variant * torrents)127 TorrentModel::removeTorrents (tr_variant * torrents) 128 128 { 129 129 int i = 0; … … 138 138 139 139 void 140 TorrentModel ::updateTorrents (tr_variant * torrents, bool isCompleteList)140 TorrentModel::updateTorrents (tr_variant * torrents, bool isCompleteList) 141 141 { 142 142 QList<Torrent*> newTorrents; … … 214 214 215 215 void 216 TorrentModel ::removeTorrent (int id)216 TorrentModel::removeTorrent (int id) 217 217 { 218 218 const int row = myIdToRow.value (id, -1); … … 236 236 237 237 void 238 TorrentModel ::getTransferSpeed (Speed & uploadSpeed,239 240 241 238 TorrentModel::getTransferSpeed (Speed & uploadSpeed, 239 size_t & uploadPeerCount, 240 Speed & downloadSpeed, 241 size_t & downloadPeerCount) 242 242 { 243 243 Speed upSpeed, downSpeed; … … 260 260 261 261 QSet<int> 262 TorrentModel ::getIds () const262 TorrentModel::getIds () const 263 263 { 264 264 QSet<int> ids; … … 272 272 273 273 bool 274 TorrentModel ::hasTorrent (const QString& hashString) const274 TorrentModel::hasTorrent (const QString& hashString) const 275 275 { 276 276 foreach (const Torrent * tor, myTorrents) -
trunk/qt/torrent.cc
r14225 r14377 30 30 31 31 32 Torrent ::Torrent (Prefs& prefs, int id):32 Torrent::Torrent (Prefs& prefs, int id): 33 33 magnetTorrent (false), 34 34 myPrefs (prefs) … … 43 43 } 44 44 45 Torrent ::~Torrent ()45 Torrent::~Torrent () 46 46 { 47 47 } … … 51 51 ***/ 52 52 53 Torrent ::Property54 Torrent ::myProperties[] =53 Torrent::Property 54 Torrent::myProperties[] = 55 55 { 56 56 { ID, TR_KEY_id, QVariant::Int, INFO, }, … … 112 112 }; 113 113 114 Torrent ::KeyList115 Torrent ::buildKeyList (Group group)114 Torrent::KeyList 115 Torrent::buildKeyList (Group group) 116 116 { 117 117 KeyList keys; … … 125 125 } 126 126 127 const Torrent ::KeyList&128 Torrent ::getInfoKeys ()127 const Torrent::KeyList& 128 Torrent::getInfoKeys () 129 129 { 130 130 static KeyList keys; … … 136 136 } 137 137 138 const Torrent ::KeyList&139 Torrent ::getStatKeys ()138 const Torrent::KeyList& 139 Torrent::getStatKeys () 140 140 { 141 141 static KeyList keys (buildKeyList(STAT)); … … 143 143 } 144 144 145 const Torrent ::KeyList&146 Torrent ::getExtraStatKeys()145 const Torrent::KeyList& 146 Torrent::getExtraStatKeys() 147 147 { 148 148 static KeyList keys; … … 155 155 156 156 bool 157 Torrent ::setInt (int i, int value)157 Torrent::setInt (int i, int value) 158 158 { 159 159 bool changed = false; … … 172 172 173 173 bool 174 Torrent ::setBool (int i, bool value)174 Torrent::setBool (int i, bool value) 175 175 { 176 176 bool changed = false; … … 189 189 190 190 bool 191 Torrent ::setDouble (int i, double value)191 Torrent::setDouble (int i, double value) 192 192 { 193 193 bool changed = false; … … 206 206 207 207 bool 208 Torrent ::setDateTime (int i, const QDateTime& value)208 Torrent::setDateTime (int i, const QDateTime& value) 209 209 { 210 210 bool changed = false; … … 223 223 224 224 bool 225 Torrent ::setSize (int i, qulonglong value)225 Torrent::setSize (int i, qulonglong value) 226 226 { 227 227 bool changed = false; … … 240 240 241 241 bool 242 Torrent ::setString (int i, const char * value)242 Torrent::setString (int i, const char * value) 243 243 { 244 244 bool changed = false; … … 257 257 258 258 bool 259 Torrent ::setIcon (int i, const QIcon& value)259 Torrent::setIcon (int i, const QIcon& value) 260 260 { 261 261 assert (0<=i && i<PROPERTY_COUNT); … … 267 267 268 268 int 269 Torrent ::getInt (int i) const269 Torrent::getInt (int i) const 270 270 { 271 271 assert (0<=i && i<PROPERTY_COUNT); … … 276 276 277 277 QDateTime 278 Torrent ::getDateTime (int i) const278 Torrent::getDateTime (int i) const 279 279 { 280 280 assert (0<=i && i<PROPERTY_COUNT); … … 285 285 286 286 bool 287 Torrent ::getBool (int i) const287 Torrent::getBool (int i) const 288 288 { 289 289 assert (0<=i && i<PROPERTY_COUNT); … … 294 294 295 295 qulonglong 296 Torrent ::getSize (int i) const296 Torrent::getSize (int i) const 297 297 { 298 298 assert (0<=i && i<PROPERTY_COUNT); … … 302 302 } 303 303 double 304 Torrent ::getDouble (int i) const304 Torrent::getDouble (int i) const 305 305 { 306 306 assert (0<=i && i<PROPERTY_COUNT); … … 310 310 } 311 311 QString 312 Torrent ::getString (int i) const312 Torrent::getString (int i) const 313 313 { 314 314 assert (0<=i && i<PROPERTY_COUNT); … … 318 318 } 319 319 QIcon 320 Torrent ::getIcon (int i) const320 Torrent::getIcon (int i) const 321 321 { 322 322 assert (0<=i && i<PROPERTY_COUNT); … … 331 331 332 332 bool 333 Torrent ::getSeedRatio (double& ratio) const333 Torrent::getSeedRatio (double& ratio) const 334 334 { 335 335 bool isLimited; … … 343 343 344 344 case TR_RATIOLIMIT_GLOBAL: 345 if ((isLimited = myPrefs.getBool (Prefs ::RATIO_ENABLED)))346 ratio = myPrefs.getDouble (Prefs ::RATIO);345 if ((isLimited = myPrefs.getBool (Prefs::RATIO_ENABLED))) 346 ratio = myPrefs.getDouble (Prefs::RATIO); 347 347 break; 348 348 … … 356 356 357 357 bool 358 Torrent ::hasFileSubstring (const QString& substr) const358 Torrent::hasFileSubstring (const QString& substr) const 359 359 { 360 360 foreach (const TrFile file, myFiles) … … 366 366 367 367 bool 368 Torrent ::hasTrackerSubstring (const QString& substr) const368 Torrent::hasTrackerSubstring (const QString& substr) const 369 369 { 370 370 foreach (QString s, myValues[TRACKERS].toStringList()) … … 376 376 377 377 int 378 Torrent ::compareSeedRatio (const Torrent& that) const378 Torrent::compareSeedRatio (const Torrent& that) const 379 379 { 380 380 double a; … … 390 390 391 391 int 392 Torrent ::compareRatio (const Torrent& that) const392 Torrent::compareRatio (const Torrent& that) const 393 393 { 394 394 const double a = ratio (); … … 403 403 404 404 int 405 Torrent ::compareETA (const Torrent& that) const405 Torrent::compareETA (const Torrent& that) const 406 406 { 407 407 const bool haveA (hasETA ()); … … 414 414 415 415 int 416 Torrent ::compareTracker (const Torrent& that) const416 Torrent::compareTracker (const Torrent& that) const 417 417 { 418 418 Q_UNUSED (that); … … 427 427 428 428 void 429 Torrent ::updateMimeIcon ()429 Torrent::updateMimeIcon () 430 430 { 431 431 const FileList& files (myFiles); … … 436 436 icon = QFileIconProvider().icon (QFileIconProvider::Folder); 437 437 else if (files.size () == 1) 438 icon = Utils ::guessMimeIcon (files.at(0).filename);438 icon = Utils::guessMimeIcon (files.at(0).filename); 439 439 else 440 440 icon = QIcon (); … … 448 448 449 449 void 450 Torrent ::notifyComplete () const450 Torrent::notifyComplete () const 451 451 { 452 452 // if someone wants to implement notification, here's the hook. … … 458 458 459 459 void 460 Torrent ::update (tr_variant * d)460 Torrent::update (tr_variant * d) 461 461 { 462 462 static bool lookup_initialized = false; … … 488 488 switch (myProperties[property_index].type) 489 489 { 490 case QVariant ::Int:490 case QVariant::Int: 491 491 { 492 492 int64_t val; … … 495 495 break; 496 496 } 497 case QVariant ::Bool:497 case QVariant::Bool: 498 498 { 499 499 bool val; … … 502 502 break; 503 503 } 504 case QVariant ::String:504 case QVariant::String: 505 505 { 506 506 const char * val; … … 509 509 break; 510 510 } 511 case QVariant ::ULongLong:511 case QVariant::ULongLong: 512 512 { 513 513 int64_t val; … … 516 516 break; 517 517 } 518 case QVariant ::Double:518 case QVariant::Double: 519 519 { 520 520 double val; … … 523 523 break; 524 524 } 525 case QVariant ::DateTime:525 case QVariant::DateTime: 526 526 { 527 527 int64_t val; 528 528 if (tr_variantGetInt (child, &val) && val) 529 changed |= setDateTime (property_index, QDateTime ::fromTime_t(val));529 changed |= setDateTime (property_index, QDateTime::fromTime_t(val)); 530 530 break; 531 531 } 532 532 533 case QVariant ::StringList:534 case TrTypes ::PeerList:533 case QVariant::StringList: 534 case TrTypes::PeerList: 535 535 // handled below 536 536 break; … … 765 765 766 766 QString 767 Torrent ::activityString () const767 Torrent::activityString () const 768 768 { 769 769 QString str; … … 784 784 785 785 QString 786 Torrent ::getError () const786 Torrent::getError () const 787 787 { 788 788 QString s = getString (ERROR_STRING); … … 800 800 801 801 QPixmap 802 TrackerStat ::getFavicon () const802 TrackerStat::getFavicon () const 803 803 { 804 804 MyApp * myApp = dynamic_cast<MyApp*>(QApplication::instance()); -
trunk/qt/tracker-delegate.cc
r14225 r14377 34 34 35 35 QSize 36 TrackerDelegate ::margin (const QStyle& style) const36 TrackerDelegate::margin (const QStyle& style) const 37 37 { 38 38 Q_UNUSED (style); … … 46 46 47 47 QSize 48 TrackerDelegate ::sizeHint (const QStyleOptionViewItem & option,49 48 TrackerDelegate::sizeHint (const QStyleOptionViewItem & option, 49 const TrackerInfo & info) const 50 50 { 51 51 Q_UNUSED (option); … … 53 53 QPixmap favicon = info.st.getFavicon (); 54 54 55 const QString text = TrackerDelegate ::getText(info);55 const QString text = TrackerDelegate::getText(info); 56 56 QTextDocument textDoc; 57 57 textDoc.setHtml (text); … … 63 63 64 64 QSize 65 TrackerDelegate ::sizeHint (const QStyleOptionViewItem & option,66 65 TrackerDelegate::sizeHint (const QStyleOptionViewItem & option, 66 const QModelIndex & index) const 67 67 { 68 68 const TrackerInfo trackerInfo = index.data (TrackerModel::TrackerRole).value<TrackerInfo>(); … … 71 71 72 72 void 73 TrackerDelegate ::paint (QPainter * painter,74 75 73 TrackerDelegate::paint (QPainter * painter, 74 const QStyleOptionViewItem & option, 75 const QModelIndex & index) const 76 76 { 77 77 const TrackerInfo trackerInfo = index.data (TrackerModel::TrackerRole).value<TrackerInfo>(); … … 85 85 86 86 void 87 TrackerDelegate ::drawTracker (QPainter * painter,88 89 87 TrackerDelegate::drawTracker (QPainter * painter, 88 const QStyleOptionViewItem & option, 89 const TrackerInfo & inf) const 90 90 { 91 91 painter->save(); … … 111 111 112 112 void 113 TrackerDelegate ::setShowMore (bool b)113 TrackerDelegate::setShowMore (bool b) 114 114 { 115 115 myShowMore = b; … … 128 128 129 129 QString 130 TrackerDelegate ::getText (const TrackerInfo& inf) const130 TrackerDelegate::getText (const TrackerInfo& inf) const 131 131 { 132 132 QString key; -
trunk/qt/tracker-model-filter.cc
r14225 r14377 11 11 #include "tracker-model-filter.h" 12 12 13 TrackerModelFilter ::TrackerModelFilter (QObject * parent):13 TrackerModelFilter::TrackerModelFilter (QObject * parent): 14 14 QSortFilterProxyModel (parent), 15 15 myShowBackups (false) … … 18 18 19 19 void 20 TrackerModelFilter ::setShowBackupTrackers (bool b)20 TrackerModelFilter::setShowBackupTrackers (bool b) 21 21 { 22 22 myShowBackups = b; … … 25 25 26 26 bool 27 TrackerModelFilter ::filterAcceptsRow (int sourceRow,28 27 TrackerModelFilter::filterAcceptsRow (int sourceRow, 28 const QModelIndex & sourceParent) const 29 29 { 30 30 QModelIndex index = sourceModel()->index(sourceRow, 0, sourceParent); -
trunk/qt/tracker-model.cc
r14225 r14377 16 16 17 17 int 18 TrackerModel ::rowCount (const QModelIndex& parent) const18 TrackerModel::rowCount (const QModelIndex& parent) const 19 19 { 20 20 Q_UNUSED (parent); … … 24 24 25 25 QVariant 26 TrackerModel ::data (const QModelIndex& index, int role) const26 TrackerModel::data (const QModelIndex& index, int role) const 27 27 { 28 28 QVariant var; … … 78 78 79 79 void 80 TrackerModel ::refresh (const TorrentModel& torrentModel, const QSet<int>& ids)80 TrackerModel::refresh (const TorrentModel& torrentModel, const QSet<int>& ids) 81 81 { 82 82 // build a list of the TrackerInfos … … 153 153 154 154 int 155 TrackerModel ::find (int torrentId, const QString& url) const155 TrackerModel::find (int torrentId, const QString& url) const 156 156 { 157 157 for (int i=0, n=myRows.size(); i<n; ++i) -
trunk/qt/triconpushbutton.cc
r14225 r14377 17 17 #include "triconpushbutton.h" 18 18 19 TrIconPushButton ::TrIconPushButton (QWidget * parent):19 TrIconPushButton::TrIconPushButton (QWidget * parent): 20 20 QPushButton (parent) 21 21 { 22 22 } 23 23 24 TrIconPushButton ::TrIconPushButton (const QIcon& icon, QWidget * parent):24 TrIconPushButton::TrIconPushButton (const QIcon& icon, QWidget * parent): 25 25 QPushButton (parent) 26 26 { … … 29 29 30 30 QSize 31 TrIconPushButton ::sizeHint () const31 TrIconPushButton::sizeHint () const 32 32 { 33 33 QSize s = iconSize (); … … 37 37 38 38 void 39 TrIconPushButton ::paintEvent (QPaintEvent *)39 TrIconPushButton::paintEvent (QPaintEvent *) 40 40 { 41 41 QStylePainter p (this); -
trunk/qt/utils.cc
r14316 r14377 41 41 42 42 QString 43 Utils ::remoteFileChooser (QWidget * parent, const QString& title, const QString& myPath, bool dir, bool local)43 Utils::remoteFileChooser (QWidget * parent, const QString& title, const QString& myPath, bool dir, bool local) 44 44 { 45 45 QString path; … … 61 61 62 62 void 63 Utils ::toStderr (const QString& str)63 Utils::toStderr (const QString& str) 64 64 { 65 65 std::cerr << qPrintable(str) << std::endl; … … 108 108 109 109 QIcon 110 Utils ::guessMimeIcon (const QString& filename)110 Utils::guessMimeIcon (const QString& filename) 111 111 { 112 112 #ifdef _WIN32 … … 134 134 if (fileIcons[0].isNull ()) 135 135 { 136 fallback = QApplication::style()->standardIcon (QStyle ::SP_FileIcon);136 fallback = QApplication::style()->standardIcon (QStyle::SP_FileIcon); 137 137 138 138 suffixes[DISK] << QString::fromLatin1("iso"); … … 189 189 190 190 bool 191 Utils :: isValidUtf8 (const char *s)191 Utils::isValidUtf8 (const char * s) 192 192 { 193 193 int n; // number of bytes in a UTF-8 sequence … … 212 212 213 213 QString 214 Utils ::removeTrailingDirSeparator (const QString& path)214 Utils::removeTrailingDirSeparator (const QString& path) 215 215 { 216 216 return path.endsWith (QDir::separator ()) -
trunk/qt/watchdir.cc
r14375 r14377 24 24 ***/ 25 25 26 WatchDir ::WatchDir (const TorrentModel& model):26 WatchDir::WatchDir (const TorrentModel& model): 27 27 myModel (model), 28 28 myWatcher (0) … … 30 30 } 31 31 32 WatchDir ::~WatchDir ()32 WatchDir::~WatchDir () 33 33 { 34 34 } … … 39 39 40 40 int 41 WatchDir ::metainfoTest (const QString& filename) const41 WatchDir::metainfoTest (const QString& filename) const 42 42 { 43 43 int ret; … … 63 63 64 64 void 65 WatchDir ::onTimeout ()65 WatchDir::onTimeout () 66 66 { 67 67 QTimer * t = qobject_cast<QTimer*>(sender()); … … 75 75 76 76 void 77 WatchDir ::setPath (const QString& path, bool isEnabled)77 WatchDir::setPath (const QString& path, bool isEnabled) 78 78 { 79 79 // clear out any remnants of the previous watcher, if any … … 98 98 99 99 void 100 WatchDir ::watcherActivated (const QString& path)100 WatchDir::watcherActivated (const QString& path) 101 101 { 102 102 const QDir dir(path); … … 143 143 144 144 void 145 WatchDir ::rescanAllWatchedDirectories ()145 WatchDir::rescanAllWatchedDirectories () 146 146 { 147 147 if (myWatcher == nullptr)
Note: See TracChangeset
for help on using the changeset viewer.