Changeset 14377


Ignore:
Timestamp:
Dec 12, 2014, 11:05:10 PM (8 years ago)
Author:
mikedld
Message:

Strip spaces around :: in C++ code (Qt client)

Location:
trunk/qt
Files:
34 edited

Legend:

Unmodified
Added
Removed
  • trunk/qt/about.cc

    r14376 r14377  
    2828#include "license.h"
    2929
    30 AboutDialog :: AboutDialog (QWidget * parent):
     30AboutDialog::AboutDialog (QWidget * parent):
    3131  QDialog (parent, Qt::Dialog),
    3232  myLicenseDialog (new LicenseDialog (this))
     
    8484
    8585void
    86 AboutDialog :: showCredits ()
     86AboutDialog::showCredits ()
    8787{
    8888  QMessageBox::about (
  • trunk/qt/add-data.cc

    r14359 r14377  
    1818
    1919int
    20 AddData :: set (const QString& key)
     20AddData::set (const QString& key)
    2121{
    2222  if (Utils::isMagnetLink (key))
     
    6565
    6666QByteArray
    67 AddData :: toBase64 () const
     67AddData::toBase64 () const
    6868{
    6969  QByteArray ret;
     
    8181
    8282QString
    83 AddData :: readableName () const
     83AddData::readableName () const
    8484{
    8585  QString ret;
  • trunk/qt/app.cc

    r14376 r14377  
    8383}
    8484
    85 MyApp :: MyApp (int& argc, char ** argv):
     85MyApp::MyApp (int& argc, char ** argv):
    8686  QApplication (argc, argv),
    8787  myPrefs(nullptr),
     
    309309
    310310void
    311 MyApp :: onTorrentsAdded (QSet<int> torrents)
     311MyApp::onTorrentsAdded (QSet<int> torrents)
    312312{
    313313  if (!myPrefs->getBool (Prefs::SHOW_NOTIFICATION_ON_ADD))
     
    333333
    334334void
    335 MyApp :: onTorrentCompleted (int id)
     335MyApp::onTorrentCompleted (int id)
    336336{
    337337  Torrent * tor = myModel->getTorrentFromId (id);
     
    356356
    357357void
    358 MyApp :: onNewTorrentChanged (int id)
     358MyApp::onNewTorrentChanged (int id)
    359359{
    360360  Torrent * tor = myModel->getTorrentFromId (id);
     
    378378
    379379void
    380 MyApp :: consentGiven ()
     380MyApp::consentGiven ()
    381381{
    382382  myPrefs->set<bool> (Prefs::USER_HAS_GIVEN_INFORMED_CONSENT, true);
    383383}
    384384
    385 MyApp :: ~MyApp ()
     385MyApp::~MyApp ()
    386386{
    387387  if (myPrefs != nullptr && myWindow != nullptr)
    388388    {
    389389      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 ());
    394394    }
    395395
     
    406406
    407407void
    408 MyApp :: refreshPref (int key)
     408MyApp::refreshPref (int key)
    409409{
    410410  switch (key)
    411411    {
    412       case Prefs :: BLOCKLIST_UPDATES_ENABLED:
     412      case Prefs::BLOCKLIST_UPDATES_ENABLED:
    413413        maybeUpdateBlocklist ();
    414414        break;
    415415
    416       case Prefs :: DIR_WATCH:
    417       case Prefs :: DIR_WATCH_ENABLED:
     416      case Prefs::DIR_WATCH:
     417      case Prefs::DIR_WATCH_ENABLED:
    418418        {
    419419          const QString path (myPrefs->getString (Prefs::DIR_WATCH));
     
    429429
    430430void
    431 MyApp :: maybeUpdateBlocklist ()
    432 {
    433   if (!myPrefs->getBool (Prefs :: BLOCKLIST_UPDATES_ENABLED))
     431MyApp::maybeUpdateBlocklist ()
     432{
     433  if (!myPrefs->getBool (Prefs::BLOCKLIST_UPDATES_ENABLED))
    434434    return;
    435435
    436   const QDateTime lastUpdatedAt = myPrefs->getDateTime (Prefs :: BLOCKLIST_DATE);
     436  const QDateTime lastUpdatedAt = myPrefs->getDateTime (Prefs::BLOCKLIST_DATE);
    437437  const QDateTime nextUpdateAt = lastUpdatedAt.addDays (7);
    438438  const QDateTime now = QDateTime::currentDateTime ();
     
    441441    {
    442442      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
     447void
     448MyApp::onSessionSourceChanged ()
    449449{
    450450  mySession->initTorrents ();
     
    454454
    455455void
    456 MyApp :: refreshTorrents ()
     456MyApp::refreshTorrents ()
    457457{
    458458  // usually we just poll the torrents that have shown recent activity,
     
    476476
    477477void
    478 MyApp :: addTorrent (const QString& key)
     478MyApp::addTorrent (const QString& key)
    479479{
    480480  const AddData addme (key);
     
    485485
    486486void
    487 MyApp :: addTorrent (const AddData& addme)
    488 {
    489   if (!myPrefs->getBool (Prefs :: OPTIONS_PROMPT))
     487MyApp::addTorrent (const AddData& addme)
     488{
     489  if (!myPrefs->getBool (Prefs::OPTIONS_PROMPT))
    490490    {
    491491      mySession->addTorrent (addme);
     
    505505
    506506void
    507 MyApp :: raise ()
    508 {
    509   QApplication :: alert (myWindow);
     507MyApp::raise ()
     508{
     509  QApplication::alert (myWindow);
    510510}
    511511
    512512bool
    513 MyApp :: notifyApp (const QString& title, const QString& body) const
     513MyApp::notifyApp (const QString& title, const QString& body) const
    514514{
    515515  const QString dbusServiceName   = QString::fromUtf8 ("org.freedesktop.Notifications");
  • trunk/qt/dbus-adaptor.cc

    r14225 r14377  
    1212#include "dbus-adaptor.h"
    1313
    14 TrDBusAdaptor :: TrDBusAdaptor (MyApp* app):
     14TrDBusAdaptor::TrDBusAdaptor (MyApp* app):
    1515  QDBusAbstractAdaptor (app),
    1616  myApp (app)
     
    1919
    2020bool
    21 TrDBusAdaptor :: PresentWindow ()
     21TrDBusAdaptor::PresentWindow ()
    2222{
    2323  myApp->raise ();
     
    2626
    2727bool
    28 TrDBusAdaptor :: AddMetainfo (const QString& key)
     28TrDBusAdaptor::AddMetainfo (const QString& key)
    2929{
    3030  AddData addme (key);
  • trunk/qt/details.cc

    r14238 r14377  
    138138
    139139QIcon
    140 Details :: getStockIcon (const QString& freedesktop_name, int fallback)
     140Details::getStockIcon (const QString& freedesktop_name, int fallback)
    141141{
    142142  QIcon icon = QIcon::fromTheme (freedesktop_name);
     
    148148}
    149149
    150 Details :: Details (Session       & session,
    151                     Prefs         & prefs,
    152                     TorrentModel  & model,
    153                     QWidget       * parent):
     150Details::Details (Session       & session,
     151                  Prefs         & prefs,
     152                  TorrentModel  & model,
     153                  QWidget       * parent):
    154154  QDialog (parent, Qt::Dialog),
    155155  mySession (session),
     
    183183
    184184  QList<int> initKeys;
    185   initKeys << Prefs :: SHOW_TRACKER_SCRAPES
    186            << Prefs :: SHOW_BACKUP_TRACKERS;
     185  initKeys << Prefs::SHOW_TRACKER_SCRAPES
     186           << Prefs::SHOW_BACKUP_TRACKERS;
    187187  foreach (int key, initKeys)
    188188    refreshPref (key);
     
    196196}
    197197
    198 Details :: ~Details ()
     198Details::~Details ()
    199199{
    200200  myTrackerDelegate->deleteLater ();
     
    204204
    205205void
    206 Details :: setIds (const QSet<int>& ids)
     206Details::setIds (const QSet<int>& ids)
    207207{
    208208  if (ids == myIds)
     
    238238
    239239void
    240 Details :: refreshPref (int key)
     240Details::refreshPref (int key)
    241241{
    242242  QString str;
     
    244244  switch (key)
    245245    {
    246       case Prefs :: SHOW_TRACKER_SCRAPES:
     246      case Prefs::SHOW_TRACKER_SCRAPES:
    247247        {
    248248          QItemSelectionModel * selectionModel (myTrackerView->selectionModel ());
     
    257257        }
    258258
    259       case Prefs :: SHOW_BACKUP_TRACKERS:
     259      case Prefs::SHOW_BACKUP_TRACKERS:
    260260        myTrackerFilter->setShowBackupTrackers (myPrefs.getBool (key));
    261261        break;
     
    272272
    273273QString
    274 Details :: timeToStringRounded (int seconds)
     274Details::timeToStringRounded (int seconds)
    275275{
    276276  if (seconds > 60)
     
    281281
    282282void
    283 Details :: onTimer ()
     283Details::onTimer ()
    284284{
    285285  getNewData ();
     
    287287
    288288void
    289 Details :: getNewData ()
     289Details::getNewData ()
    290290{
    291291  if (!myIds.empty ())
     
    306306
    307307void
    308 Details :: onTorrentChanged ()
     308Details::onTorrentChanged ()
    309309{
    310310  if (!myHavePendingRefresh)
     
    349349
    350350void
    351 Details :: refresh ()
     351Details::refresh ()
    352352{
    353353  const int n = myIds.size ();
     
    924924
    925925void
    926 Details :: enableWhenChecked (QCheckBox * box, QWidget * w)
     926Details::enableWhenChecked (QCheckBox * box, QWidget * w)
    927927{
    928928  connect (box, SIGNAL (toggled (bool)), w, SLOT (setEnabled (bool)));
     
    936936
    937937QWidget *
    938 Details :: createInfoTab ()
     938Details::createInfoTab ()
    939939{
    940940  HIG * hig = new HIG (this);
     
    974974
    975975void
    976 Details :: onShowTrackerScrapesToggled (bool val)
     976Details::onShowTrackerScrapesToggled (bool val)
    977977{
    978978  myPrefs.set (Prefs::SHOW_TRACKER_SCRAPES, val);
     
    980980
    981981void
    982 Details :: onShowBackupTrackersToggled (bool val)
     982Details::onShowBackupTrackersToggled (bool val)
    983983{
    984984  myPrefs.set (Prefs::SHOW_BACKUP_TRACKERS, val);
     
    986986
    987987void
    988 Details :: onHonorsSessionLimitsToggled (bool val)
     988Details::onHonorsSessionLimitsToggled (bool val)
    989989{
    990990  mySession.torrentSet (myIds, TR_KEY_honorsSessionLimits, val);
     
    992992}
    993993void
    994 Details :: onDownloadLimitedToggled (bool val)
     994Details::onDownloadLimitedToggled (bool val)
    995995{
    996996  mySession.torrentSet (myIds, TR_KEY_downloadLimited, val);
     
    998998}
    999999void
    1000 Details :: onSpinBoxEditingFinished ()
     1000Details::onSpinBoxEditingFinished ()
    10011001{
    10021002  const QObject * spin = sender ();
     
    10111011
    10121012void
    1013 Details :: onUploadLimitedToggled (bool val)
     1013Details::onUploadLimitedToggled (bool val)
    10141014{
    10151015  mySession.torrentSet (myIds, TR_KEY_uploadLimited, val);
     
    10181018
    10191019void
    1020 Details :: onIdleModeChanged (int index)
     1020Details::onIdleModeChanged (int index)
    10211021{
    10221022  const int val = myIdleCombo->itemData (index).toInt ();
     
    10261026
    10271027void
    1028 Details :: onRatioModeChanged (int index)
     1028Details::onRatioModeChanged (int index)
    10291029{
    10301030  const int val = myRatioCombo->itemData (index).toInt ();
     
    10331033
    10341034void
    1035 Details :: onBandwidthPriorityChanged (int index)
     1035Details::onBandwidthPriorityChanged (int index)
    10361036{
    10371037  if (index != -1)
     
    10441044
    10451045void
    1046 Details :: onTrackerSelectionChanged ()
     1046Details::onTrackerSelectionChanged ()
    10471047{
    10481048  const int selectionCount = myTrackerView->selectionModel ()->selectedRows ().size ();
     
    10521052
    10531053void
    1054 Details :: onAddTrackerClicked ()
     1054Details::onAddTrackerClicked ()
    10551055{
    10561056  bool ok = false;
     
    10901090
    10911091void
    1092 Details :: onEditTrackerClicked ()
     1092Details::onEditTrackerClicked ()
    10931093{
    10941094  QItemSelectionModel * selectionModel = myTrackerView->selectionModel ();
     
    11261126
    11271127void
    1128 Details :: onRemoveTrackerClicked ()
     1128Details::onRemoveTrackerClicked ()
    11291129{
    11301130  // make a map of torrentIds to announce URLs to remove
     
    11511151
    11521152QWidget *
    1153 Details :: createOptionsTab ()
     1153Details::createOptionsTab ()
    11541154{
    11551155  QSpinBox * s;
     
    12041204
    12051205  h = new QHBoxLayout ();
    1206   h->setSpacing (HIG :: PAD);
     1206  h->setSpacing (HIG::PAD);
    12071207  m = new QComboBox;
    12081208  m->addItem (tr ("Use Global Settings"),      TR_RATIOLIMIT_GLOBAL);
     
    12191219
    12201220  h = new QHBoxLayout ();
    1221   h->setSpacing (HIG :: PAD);
     1221  h->setSpacing (HIG::PAD);
    12221222  m = new QComboBox;
    12231223  m->addItem (tr ("Use Global Settings"),                 TR_IDLELIMIT_GLOBAL);
     
    12561256
    12571257QWidget *
    1258 Details :: createTrackerTab ()
     1258Details::createTrackerTab ()
    12591259{
    12601260  QCheckBox * c;
     
    13391339
    13401340QWidget *
    1341 Details :: createPeersTab ()
     1341Details::createPeersTab ()
    13421342{
    13431343  QWidget * top = new QWidget;
    13441344  QVBoxLayout * v = new QVBoxLayout (top);
    1345   v->setSpacing (HIG :: PAD_BIG);
     1345  v->setSpacing (HIG::PAD_BIG);
    13461346  v->setContentsMargins (HIG::PAD_BIG, HIG::PAD_BIG, HIG::PAD_BIG, HIG::PAD_BIG);
    13471347
     
    13801380
    13811381QWidget *
    1382 Details :: createFilesTab ()
     1382Details::createFilesTab ()
    13831383{
    13841384  myFileTreeView = new FileTreeView ();
     
    14001400
    14011401void
    1402 Details :: onFilePriorityChanged (const QSet<int>& indices, int priority)
     1402Details::onFilePriorityChanged (const QSet<int>& indices, int priority)
    14031403{
    14041404  tr_quark key;
     
    14241424
    14251425void
    1426 Details :: onFileWantedChanged (const QSet<int>& indices, bool wanted)
     1426Details::onFileWantedChanged (const QSet<int>& indices, bool wanted)
    14271427{
    14281428  const tr_quark key = wanted ? TR_KEY_files_wanted : TR_KEY_files_unwanted;
     
    14321432
    14331433void
    1434 Details :: onPathEdited (const QString& oldpath, const QString& newname)
     1434Details::onPathEdited (const QString& oldpath, const QString& newname)
    14351435{
    14361436  mySession.torrentRenamePath (myIds, oldpath, newname);
     
    14381438
    14391439void
    1440 Details :: onOpenRequested (const QString& path)
     1440Details::onOpenRequested (const QString& path)
    14411441{
    14421442  if (!mySession.isLocal ())
  • trunk/qt/favicon.cc

    r14225 r14377  
    2525***/
    2626
    27 Favicons :: Favicons ()
     27Favicons::Favicons ()
    2828{
    2929  myNAM = new QNetworkAccessManager ();
     
    3131}
    3232
    33 Favicons :: ~Favicons ()
     33Favicons::~Favicons ()
    3434{
    3535  delete myNAM;
     
    4141
    4242QString
    43 Favicons :: getCacheDir ()
     43Favicons::getCacheDir ()
    4444{
    4545  const QString base =
     
    5454
    5555void
    56 Favicons :: ensureCacheDirHasBeenScanned ()
     56Favicons::ensureCacheDirHasBeenScanned ()
    5757{
    5858  static bool hasBeenScanned = false;
     
    7777
    7878QString
    79 Favicons :: getHost (const QUrl& url)
     79Favicons::getHost (const QUrl& url)
    8080{
    8181  QString host = url.host ();
     
    9090
    9191QPixmap
    92 Favicons :: find (const QUrl& url)
     92Favicons::find (const QUrl& url)
    9393{
    9494  return findFromHost (getHost (url));
     
    101101
    102102QPixmap
    103 Favicons :: findFromHost (const QString& host)
     103Favicons::findFromHost (const QString& host)
    104104{
    105105  ensureCacheDirHasBeenScanned ();
     
    110110
    111111void
    112 Favicons :: add (const QUrl& url)
     112Favicons::add (const QUrl& url)
    113113{
    114114  ensureCacheDirHasBeenScanned ();
     
    133133
    134134void
    135 Favicons :: onRequestFinished (QNetworkReply * reply)
     135Favicons::onRequestFinished (QNetworkReply * reply)
    136136{
    137137  const QString host = reply->url().host();
  • trunk/qt/file-tree.cc

    r14345 r14377  
    4545
    4646const QHash<QString,int>&
    47 FileTreeItem :: getMyChildRows ()
     47FileTreeItem::getMyChildRows ()
    4848{
    4949  const size_t n = childCount();
     
    6161
    6262
    63 FileTreeItem :: ~FileTreeItem ()
     63FileTreeItem::~FileTreeItem ()
    6464{
    6565  assert(myChildren.isEmpty());
     
    7676
    7777void
    78 FileTreeItem :: appendChild (FileTreeItem * child)
     78FileTreeItem::appendChild (FileTreeItem * child)
    7979{
    8080  const size_t n = childCount();
     
    8585
    8686FileTreeItem *
    87 FileTreeItem :: child (const QString& filename)
     87FileTreeItem::child (const QString& filename)
    8888{
    8989  FileTreeItem * item(0);
     
    100100
    101101int
    102 FileTreeItem :: row () const
     102FileTreeItem::row () const
    103103{
    104104  int i(-1);
     
    114114
    115115QVariant
    116 FileTreeItem :: data (int column, int role) const
     116FileTreeItem::data (int column, int role) const
    117117{
    118118  QVariant value;
     
    168168
    169169void
    170 FileTreeItem :: getSubtreeWantedSize (uint64_t& have, uint64_t& total) const
     170FileTreeItem::getSubtreeWantedSize (uint64_t& have, uint64_t& total) const
    171171{
    172172  if (myIsWanted)
     
    181181
    182182double
    183 FileTreeItem :: progress () const
     183FileTreeItem::progress () const
    184184{
    185185  double d(0);
     
    194194
    195195QString
    196 FileTreeItem :: sizeString () const
     196FileTreeItem::sizeString () const
    197197{
    198198  QString str;
     
    214214
    215215std::pair<int,int>
    216 FileTreeItem :: update (const QString& name,
    217                         bool           wanted,
    218                         int            priority,
    219                         uint64_t       haveSize,
    220                         bool           updateFields)
     216FileTreeItem::update (const QString& name,
     217                      bool           wanted,
     218                      int            priority,
     219                      uint64_t       haveSize,
     220                      bool           updateFields)
    221221{
    222222  int changed_count = 0;
     
    267267
    268268QString
    269 FileTreeItem :: priorityString () const
     269FileTreeItem::priorityString () const
    270270{
    271271  const int i = priority();
     
    281281
    282282int
    283 FileTreeItem :: priority () const
     283FileTreeItem::priority () const
    284284{
    285285  int i(0);
     
    310310
    311311void
    312 FileTreeItem :: setSubtreePriority (int i, QSet<int>& ids)
     312FileTreeItem::setSubtreePriority (int i, QSet<int>& ids)
    313313{
    314314  if (myPriority != i)
     
    325325
    326326void
    327 FileTreeItem :: twiddlePriority (QSet<int>& ids, int& p)
     327FileTreeItem::twiddlePriority (QSet<int>& ids, int& p)
    328328{
    329329  const int old(priority());
     
    340340
    341341int
    342 FileTreeItem :: isSubtreeWanted () const
     342FileTreeItem::isSubtreeWanted () const
    343343{
    344344  if(myChildren.isEmpty())
     
    364364
    365365void
    366 FileTreeItem :: setSubtreeWanted (bool b, QSet<int>& ids)
     366FileTreeItem::setSubtreeWanted (bool b, QSet<int>& ids)
    367367{
    368368  if (myIsWanted != b)
     
    379379
    380380void
    381 FileTreeItem :: twiddleWanted (QSet<int>& ids, bool& wanted)
     381FileTreeItem::twiddleWanted (QSet<int>& ids, bool& wanted)
    382382{
    383383  wanted = isSubtreeWanted() != Qt::Checked;
     
    386386
    387387QString
    388 FileTreeItem :: path () const
     388FileTreeItem::path () const
    389389{
    390390  QString itemPath;
     
    404404
    405405bool
    406 FileTreeItem :: isComplete () const
     406FileTreeItem::isComplete () const
    407407{
    408408  return myHaveSize == totalSize ();
     
    414414***/
    415415
    416 FileTreeModel :: FileTreeModel (QObject *parent, bool isEditable):
     416FileTreeModel::FileTreeModel (QObject * parent, bool isEditable):
    417417  QAbstractItemModel(parent),
    418418  myRootItem (new FileTreeItem),
     
    422422}
    423423
    424 FileTreeModel :: ~FileTreeModel()
     424FileTreeModel::~FileTreeModel()
    425425{
    426426  clear();
     
    430430
    431431FileTreeItem *
    432 FileTreeModel :: itemFromIndex (const QModelIndex& index) const
     432FileTreeModel::itemFromIndex (const QModelIndex& index) const
    433433{
    434434  return static_cast<FileTreeItem*>(index.internalPointer());
     
    436436
    437437QVariant
    438 FileTreeModel :: data (const QModelIndex &index, int role) const
     438FileTreeModel::data (const QModelIndex &index, int role) const
    439439{
    440440  QVariant value;
     
    447447
    448448Qt::ItemFlags
    449 FileTreeModel :: flags (const QModelIndex& index) const
     449FileTreeModel::flags (const QModelIndex& index) const
    450450{
    451451  int i(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
     
    461461
    462462bool
    463 FileTreeModel :: setData (const QModelIndex& index, const QVariant& newname, int role)
     463FileTreeModel::setData (const QModelIndex& index, const QVariant& newname, int role)
    464464{
    465465  if (role == Qt::EditRole)
     
    474474
    475475QVariant
    476 FileTreeModel :: headerData (int column, Qt::Orientation orientation, int role) const
     476FileTreeModel::headerData (int column, Qt::Orientation orientation, int role) const
    477477{
    478478  QVariant data;
     
    511511
    512512QModelIndex
    513 FileTreeModel :: index (int row, int column, const QModelIndex& parent) const
     513FileTreeModel::index (int row, int column, const QModelIndex& parent) const
    514514{
    515515  QModelIndex i;
     
    534534
    535535QModelIndex
    536 FileTreeModel :: parent (const QModelIndex& child) const
     536FileTreeModel::parent (const QModelIndex& child) const
    537537{
    538538  return parent (child, 0); // QAbstractItemModel::parent() wants col 0
     
    540540
    541541QModelIndex
    542 FileTreeModel :: parent (const QModelIndex& child, int column) const
     542FileTreeModel::parent (const QModelIndex& child, int column) const
    543543{
    544544  QModelIndex parent;
     
    551551
    552552int
    553 FileTreeModel :: rowCount (const QModelIndex& parent) const
     553FileTreeModel::rowCount (const QModelIndex& parent) const
    554554{
    555555  FileTreeItem * parentItem;
     
    564564
    565565int
    566 FileTreeModel :: columnCount (const QModelIndex &parent) const
     566FileTreeModel::columnCount (const QModelIndex& parent) const
    567567{
    568568  Q_UNUSED(parent);
     
    572572
    573573QModelIndex
    574 FileTreeModel :: indexOf (FileTreeItem * item, int column) const
     574FileTreeModel::indexOf (FileTreeItem * item, int column) const
    575575{
    576576  if (!item || item==myRootItem)
     
    581581
    582582void
    583 FileTreeModel :: clearSubtree (const QModelIndex& top)
     583FileTreeModel::clearSubtree (const QModelIndex& top)
    584584{
    585585  size_t i = rowCount (top);
     
    599599
    600600void
    601 FileTreeModel :: clear ()
     601FileTreeModel::clear ()
    602602{
    603603  beginResetModel ();
     
    609609
    610610FileTreeItem *
    611 FileTreeModel :: findItemForFileIndex (int fileIndex) const
     611FileTreeModel::findItemForFileIndex (int fileIndex) const
    612612{
    613613  return myIndexCache.value (fileIndex, 0);
     
    615615
    616616void
    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)
     617FileTreeModel::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)
    625625{
    626626  bool added = false;
     
    691691
    692692void
    693 FileTreeModel :: parentsChanged (const QModelIndex& index, int firstColumn, int lastColumn)
     693FileTreeModel::parentsChanged (const QModelIndex& index, int firstColumn, int lastColumn)
    694694{
    695695  assert (firstColumn <= lastColumn);
     
    708708
    709709void
    710 FileTreeModel :: subtreeChanged (const QModelIndex& index, int firstColumn, int lastColumn)
     710FileTreeModel::subtreeChanged (const QModelIndex& index, int firstColumn, int lastColumn)
    711711{
    712712  assert (firstColumn <= lastColumn);
     
    725725
    726726void
    727 FileTreeModel :: clicked (const QModelIndex& index)
     727FileTreeModel::clicked (const QModelIndex& index)
    728728{
    729729  const int column (index.column());
     
    763763
    764764void
    765 FileTreeModel :: doubleClicked (const QModelIndex& index)
     765FileTreeModel::doubleClicked (const QModelIndex& index)
    766766{
    767767  if (!index.isValid())
     
    783783
    784784QSize
    785 FileTreeDelegate :: sizeHint(const QStyleOptionViewItem& item, const QModelIndex& index) const
     785FileTreeDelegate::sizeHint(const QStyleOptionViewItem& item, const QModelIndex& index) const
    786786{
    787787  QSize size;
     
    803803
    804804void
    805 FileTreeDelegate :: paint (QPainter                    * painter,
    806                            const QStyleOptionViewItem  & option,
    807                            const QModelIndex           & index) const
     805FileTreeDelegate::paint (QPainter                    * painter,
     806                         const QStyleOptionViewItem  & option,
     807                         const QModelIndex           & index) const
    808808{
    809809  const int column(index.column());
     
    815815    }
    816816
    817   QStyle * style (QApplication :: style());
     817  QStyle * style (QApplication::style ());
    818818
    819819  painter->save();
     
    864864****/
    865865
    866 FileTreeView :: FileTreeView (QWidget * parent, bool isEditable):
     866FileTreeView::FileTreeView (QWidget * parent, bool isEditable):
    867867  QTreeView (parent),
    868868  myModel (this, isEditable),
     
    912912}
    913913
    914 FileTreeView :: ~FileTreeView ()
     914FileTreeView::~FileTreeView ()
    915915{
    916916  myProxy->deleteLater();
     
    918918
    919919void
    920 FileTreeView :: onClicked (const QModelIndex& proxyIndex)
     920FileTreeView::onClicked (const QModelIndex& proxyIndex)
    921921{
    922922  const QModelIndex modelIndex = myProxy->mapToSource (proxyIndex);
     
    925925
    926926void
    927 FileTreeView :: onDoubleClicked (const QModelIndex& proxyIndex)
     927FileTreeView::onDoubleClicked (const QModelIndex& proxyIndex)
    928928{
    929929  const QModelIndex modelIndex = myProxy->mapToSource (proxyIndex);
     
    932932
    933933void
    934 FileTreeView :: onOpenRequested (const QString& path)
     934FileTreeView::onOpenRequested (const QString& path)
    935935{
    936936  if (state () == EditingState)
     
    941941
    942942bool
    943 FileTreeView :: eventFilter (QObject * o, QEvent * event)
     943FileTreeView::eventFilter (QObject * o, QEvent * event)
    944944{
    945945  // this is kind of a hack to get the last three columns be the
     
    995995
    996996void
    997 FileTreeView :: update (const FileList& files, bool updateFields)
     997FileTreeView::update (const FileList& files, bool updateFields)
    998998{
    999999  foreach (const TrFile file, files)
     
    10071007
    10081008void
    1009 FileTreeView :: clear ()
     1009FileTreeView::clear ()
    10101010{
    10111011  myModel.clear();
  • trunk/qt/filterbar.cc

    r14225 r14377  
    4949}
    5050
    51 FilterBarComboBoxDelegate :: FilterBarComboBoxDelegate (QObject * parent, QComboBox * combo):
     51FilterBarComboBoxDelegate::FilterBarComboBoxDelegate (QObject * parent, QComboBox * combo):
    5252  QItemDelegate (parent),
    5353  myCombo (combo)
     
    5656
    5757bool
    58 FilterBarComboBoxDelegate :: isSeparator (const QModelIndex &index)
     58FilterBarComboBoxDelegate::isSeparator (const QModelIndex& index)
    5959{
    6060  return index.data (Qt::AccessibleDescriptionRole).toString () == QLatin1String ("separator");
    6161}
    6262void
    63 FilterBarComboBoxDelegate :: setSeparator (QAbstractItemModel * model, const QModelIndex& index)
     63FilterBarComboBoxDelegate::setSeparator (QAbstractItemModel * model, const QModelIndex& index)
    6464{
    6565  model->setData (index, QString::fromLatin1 ("separator"), Qt::AccessibleDescriptionRole);
     
    7171
    7272void
    73 FilterBarComboBoxDelegate :: paint (QPainter                    * painter,
    74                                     const QStyleOptionViewItem  & option,
    75                                     const QModelIndex           & index) const
     73FilterBarComboBoxDelegate::paint (QPainter                    * painter,
     74                                  const QStyleOptionViewItem  & option,
     75                                  const QModelIndex           & index) const
    7676{
    7777  if (isSeparator (index))
     
    121121
    122122QSize
    123 FilterBarComboBoxDelegate :: sizeHint (const QStyleOptionViewItem & option,
    124                                        const QModelIndex          & index) const
     123FilterBarComboBoxDelegate::sizeHint (const QStyleOptionViewItem & option,
     124                                     const QModelIndex          & index) const
    125125{
    126126  if (isSeparator (index))
     
    147147**/
    148148
    149 FilterBarComboBox :: FilterBarComboBox (QWidget * parent):
     149FilterBarComboBox::FilterBarComboBox (QWidget * parent):
    150150  QComboBox (parent)
    151151{
     
    153153
    154154int
    155 FilterBarComboBox :: currentCount () const
     155FilterBarComboBox::currentCount () const
    156156{
    157157  int count = 0;
     
    165165
    166166void
    167 FilterBarComboBox :: paintEvent (QPaintEvent * e)
     167FilterBarComboBox::paintEvent (QPaintEvent * e)
    168168{
    169169  Q_UNUSED (e);
     
    227227
    228228FilterBarComboBox *
    229 FilterBar :: createActivityCombo ()
     229FilterBar::createActivityCombo ()
    230230{
    231231  FilterBarComboBox * c = new FilterBarComboBox (this);
     
    300300
    301301void
    302 FilterBar :: refreshTrackers ()
     302FilterBar::refreshTrackers ()
    303303{
    304304  Favicons& favicons = dynamic_cast<MyApp*> (QApplication::instance ())->favicons;
     
    393393
    394394FilterBarComboBox *
    395 FilterBar :: createTrackerCombo (QStandardItemModel * model)
     395FilterBar::createTrackerCombo (QStandardItemModel * model)
    396396{
    397397  FilterBarComboBox * c = new FilterBarComboBox (this);
     
    419419****/
    420420
    421 FilterBar :: FilterBar (Prefs& prefs, TorrentModel& torrents, TorrentFilter& filter, QWidget * parent):
     421FilterBar::FilterBar (Prefs& prefs, TorrentModel& torrents, TorrentFilter& filter, QWidget * parent):
    422422  QWidget (parent),
    423423  myPrefs (prefs),
     
    477477  // initialize our state
    478478  QList<int> initKeys;
    479   initKeys << Prefs :: FILTER_MODE
    480            << Prefs :: FILTER_TRACKERS;
     479  initKeys << Prefs::FILTER_MODE
     480           << Prefs::FILTER_TRACKERS;
    481481  foreach (int key, initKeys)
    482482      refreshPref (key);
    483483}
    484484
    485 FilterBar :: ~FilterBar ()
     485FilterBar::~FilterBar ()
    486486{
    487487  delete myRecountTimer;
     
    493493
    494494void
    495 FilterBar :: refreshPref (int key)
     495FilterBar::refreshPref (int key)
    496496{
    497497  switch (key)
    498498    {
    499       case Prefs :: FILTER_MODE:
     499      case Prefs::FILTER_MODE:
    500500        {
    501501          const FilterMode m = myPrefs.get<FilterMode> (key);
     
    506506        }
    507507
    508       case Prefs :: FILTER_TRACKERS:
     508      case Prefs::FILTER_TRACKERS:
    509509        {
    510510          const QString tracker = myPrefs.getString (key);
     
    527527
    528528void
    529 FilterBar :: onTextChanged (const QString& str)
     529FilterBar::onTextChanged (const QString& str)
    530530{
    531531  if (!myIsBootstrapping)
     
    534534
    535535void
    536 FilterBar :: onTrackerIndexChanged (int i)
     536FilterBar::onTrackerIndexChanged (int i)
    537537{
    538538  if (!myIsBootstrapping)
     
    556556
    557557void
    558 FilterBar :: onActivityIndexChanged (int i)
     558FilterBar::onActivityIndexChanged (int i)
    559559{
    560560  if (!myIsBootstrapping)
     
    569569***/
    570570
    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 ()
     571void FilterBar::onTorrentModelReset () { recountSoon (); }
     572void FilterBar::onTorrentModelRowsInserted (const QModelIndex&, int, int) { recountSoon (); }
     573void FilterBar::onTorrentModelRowsRemoved (const QModelIndex&, int, int) { recountSoon (); }
     574void FilterBar::onTorrentModelDataChanged (const QModelIndex&, const QModelIndex&) { recountSoon (); }
     575
     576void
     577FilterBar::recountSoon ()
    578578{
    579579  if (!myRecountTimer->isActive ())
     
    584584}
    585585void
    586 FilterBar :: recount ()
     586FilterBar::recount ()
    587587{
    588588  QAbstractItemModel * model = myActivityCombo->model ();
     
    605605
    606606QString
    607 FilterBar :: getCountString (int n) const
     607FilterBar::getCountString (int n) const
    608608{
    609609  return QString ("%L1").arg (n);
     
    611611
    612612void
    613 FilterBar :: refreshCountLabel ()
     613FilterBar::refreshCountLabel ()
    614614{
    615615  const int visibleCount = myFilter.rowCount ();
  • trunk/qt/filters.cc

    r14225 r14377  
    2323
    2424int
    25 FilterMode :: modeFromName( const QString& name )
     25FilterMode::modeFromName (const QString& name)
    2626{
    2727  for (int i=0; i<NUM_MODES; ++i)
     
    4747
    4848int
    49 SortMode :: modeFromName (const QString& name)
     49SortMode::modeFromName (const QString& name)
    5050{
    5151  for (int i=0; i<NUM_MODES; ++i)
  • trunk/qt/formatter.cc

    r14225 r14377  
    3030
    3131void
    32 Formatter :: initUnits ()
     32Formatter::initUnits ()
    3333{
    3434 speed_K = 1000;
     
    7474
    7575double
    76 Speed :: KBps () const
     76Speed::KBps () const
    7777{
    7878  return _Bps / (double)speed_K;
     
    8080
    8181Speed
    82 Speed :: fromKBps (double KBps)
     82Speed::fromKBps (double KBps)
    8383{
    8484  return int (KBps * speed_K);
     
    9090
    9191QString
    92 Formatter :: memToString (int64_t bytes)
     92Formatter::memToString (int64_t bytes)
    9393{
    9494  if (bytes < 0)
     
    104104
    105105QString
    106 Formatter :: sizeToString (int64_t bytes)
     106Formatter::sizeToString (int64_t bytes)
    107107{
    108108  if (bytes < 0)
     
    118118
    119119QString
    120 Formatter :: speedToString (const Speed& speed)
     120Formatter::speedToString (const Speed& speed)
    121121{
    122122  char buf[128];
     
    126126
    127127QString
    128 Formatter :: uploadSpeedToString (const Speed& uploadSpeed)
     128Formatter::uploadSpeedToString (const Speed& uploadSpeed)
    129129{
    130130  static const QChar uploadSymbol (0x25B4);
     
    134134
    135135QString
    136 Formatter :: downloadSpeedToString (const Speed& downloadSpeed)
     136Formatter::downloadSpeedToString (const Speed& downloadSpeed)
    137137{
    138138  static const QChar downloadSymbol (0x25BE);
     
    142142
    143143QString
    144 Formatter :: percentToString (double x)
     144Formatter::percentToString (double x)
    145145{
    146146  char buf[128];
     
    149149
    150150QString
    151 Formatter :: ratioToString (double ratio)
     151Formatter::ratioToString (double ratio)
    152152{
    153153  char buf[128];
     
    156156
    157157QString
    158 Formatter :: timeToString (int seconds)
     158Formatter::timeToString (int seconds)
    159159{
    160160  int days, hours, minutes;
  • trunk/qt/freespace-label.cc

    r14226 r14377  
    2020}
    2121
    22 FreespaceLabel :: FreespaceLabel (Session        & session,
    23                                   const QString  & path,
    24                                   QWidget        * parent):
     22FreespaceLabel::FreespaceLabel (Session        & session,
     23                                const QString  & path,
     24                                QWidget        * parent):
    2525  QLabel (parent),
    2626  mySession (session),
     
    4141
    4242void
    43 FreespaceLabel :: setPath (const QString& path)
     43FreespaceLabel::setPath (const QString& path)
    4444{
    4545  if (myPath != path)
     
    5252
    5353void
    54 FreespaceLabel :: onTimer ()
     54FreespaceLabel::onTimer ()
    5555{
    5656  const int64_t tag = mySession.getUniqueTag ();
     
    6969
    7070void
    71 FreespaceLabel :: onSessionExecuted (int64_t tag, const QString& result, struct tr_variant * arguments)
     71FreespaceLabel::onSessionExecuted (int64_t tag, const QString& result, struct tr_variant * arguments)
    7272{
    7373  Q_UNUSED (result);
  • trunk/qt/hig.cc

    r14225 r14377  
    1818
    1919
    20 HIG :: HIG (QWidget * parent):
     20HIG::HIG (QWidget * parent):
    2121  QWidget (parent),
    2222  myRow (0),
     
    3030}
    3131
    32 HIG :: ~HIG ()
     32HIG::~HIG ()
    3333{
    3434  delete myGrid;
     
    4040
    4141void
    42 HIG :: addSectionDivider ()
     42HIG::addSectionDivider ()
    4343{
    4444  QWidget * w = new QWidget (this);
     
    4848
    4949void
    50 HIG :: addSectionTitle (const QString& title)
     50HIG::addSectionTitle (const QString& title)
    5151{
    5252  QLabel * label = new QLabel (this);
     
    5858
    5959void
    60 HIG :: addSectionTitle (QWidget * w)
     60HIG::addSectionTitle (QWidget * w)
    6161{
    6262  myGrid->addWidget (w, myRow, 0, 1, 2, Qt::AlignLeft|Qt::AlignVCenter);
     
    6565
    6666void
    67 HIG :: addSectionTitle (QLayout * l)
     67HIG::addSectionTitle (QLayout * l)
    6868{
    6969  myGrid->addLayout (l, myRow, 0, 1, 2, Qt::AlignLeft|Qt::AlignVCenter);
     
    7373
    7474QLayout *
    75 HIG :: addRow (QWidget * w)
     75HIG::addRow (QWidget * w)
    7676{
    7777  QHBoxLayout * h = new QHBoxLayout ();
     
    8787
    8888void
    89 HIG :: addWideControl (QLayout * l)
     89HIG::addWideControl (QLayout * l)
    9090{
    9191  QHBoxLayout * h = new QHBoxLayout ();
     
    9797
    9898void
    99 HIG :: addWideControl (QWidget * w)
     99HIG::addWideControl (QWidget * w)
    100100{
    101101  QHBoxLayout * h = new QHBoxLayout ();
     
    107107
    108108QCheckBox*
    109 HIG :: addWideCheckBox (const QString& text, bool isChecked)
     109HIG::addWideCheckBox (const QString& text, bool isChecked)
    110110{
    111111  QCheckBox * check = new QCheckBox (text, this);
     
    116116
    117117void
    118 HIG :: addLabel (QWidget * w)
     118HIG::addLabel (QWidget * w)
    119119{
    120120  QHBoxLayout * h = new QHBoxLayout ();
     
    125125
    126126QLabel*
    127 HIG :: addLabel (const QString& text)
     127HIG::addLabel (const QString& text)
    128128{
    129129  QLabel * label = new QLabel (text, this);
     
    133133
    134134void
    135 HIG :: addTallLabel (QWidget * w)
     135HIG::addTallLabel (QWidget * w)
    136136{
    137137  QHBoxLayout * h = new QHBoxLayout ();
     
    142142
    143143QLabel*
    144 HIG :: addTallLabel (const QString& text)
     144HIG::addTallLabel (const QString& text)
    145145{
    146146  QLabel * label = new QLabel (text, this);
     
    150150
    151151void
    152 HIG :: addControl (QWidget * w)
     152HIG::addControl (QWidget * w)
    153153{
    154154  myGrid->addWidget (w, myRow, 1, 1, 1);
     
    156156
    157157void
    158 HIG :: addControl (QLayout * l)
     158HIG::addControl (QLayout * l)
    159159{
    160160  myGrid->addLayout (l, myRow, 1, 1, 1);
     
    162162
    163163QLabel *
    164 HIG :: addRow (const QString& text, QWidget * control, QWidget * buddy)
     164HIG::addRow (const QString& text, QWidget * control, QWidget * buddy)
    165165{
    166166  QLabel * label = addLabel (text);
     
    172172
    173173QLabel *
    174 HIG :: addTallRow (const QString& text, QWidget * control, QWidget * buddy)
     174HIG::addTallRow (const QString& text, QWidget * control, QWidget * buddy)
    175175{
    176176  QLabel* label = addTallLabel (text);
     
    184184
    185185QLabel *
    186 HIG :: addRow (const QString& text, QLayout * control, QWidget * buddy)
     186HIG::addRow (const QString& text, QLayout * control, QWidget * buddy)
    187187{
    188188  QLabel * label = addLabel (text);
     
    195195
    196196void
    197 HIG :: addRow (QWidget * label, QWidget * control, QWidget * buddy)
     197HIG::addRow (QWidget * label, QWidget * control, QWidget * buddy)
    198198{
    199199  addLabel (label);
     
    212212
    213213void
    214 HIG :: addRow (QWidget * label, QLayout * control, QWidget * buddy)
     214HIG::addRow (QWidget * label, QLayout * control, QWidget * buddy)
    215215{
    216216  addLabel (label);
     
    229229
    230230void
    231 HIG :: finish ()
     231HIG::finish ()
    232232{
    233233  if (!myHasTall)
  • trunk/qt/license.cc

    r14242 r14377  
    1414#include "license.h"
    1515
    16 LicenseDialog :: LicenseDialog (QWidget * parent):
     16LicenseDialog::LicenseDialog (QWidget * parent):
    1717  QDialog (parent, Qt::Dialog)
    1818{
  • trunk/qt/mainwin.cc

    r14376 r14377  
    7373
    7474QIcon
    75 TrMainWindow :: getStockIcon (const QString& name, int fallback)
     75TrMainWindow::getStockIcon (const QString& name, int fallback)
    7676{
    7777  QIcon icon = QIcon::fromTheme (name);
     
    8383}
    8484
    85 TrMainWindow :: TrMainWindow (Session& session, Prefs& prefs, TorrentModel& model, bool minimized):
     85TrMainWindow::TrMainWindow (Session& session, Prefs& prefs, TorrentModel& model, bool minimized):
    8686  myLastFullUpdateTime (0),
    8787  mySessionDialog (new SessionDialog (session, prefs, this)),
     
    249249
    250250  QList<int> initKeys;
    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;
     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;
    267267  foreach (int key, initKeys)
    268268    refreshPref (key);
     
    296296}
    297297
    298 TrMainWindow :: ~TrMainWindow ()
     298TrMainWindow::~TrMainWindow ()
    299299{
    300300}
     
    305305
    306306void
    307 TrMainWindow :: onSessionSourceChanged ()
     307TrMainWindow::onSessionSourceChanged ()
    308308{
    309309  myModel.clear ();
     
    311311
    312312void
    313 TrMainWindow :: onModelReset ()
     313TrMainWindow::onModelReset ()
    314314{
    315315  refreshTitle ();
     
    326326
    327327void
    328 TrMainWindow :: onSetPrefs ()
     328TrMainWindow::onSetPrefs ()
    329329{
    330330  const QVariantList p = sender ()->property (PREF_VARIANTS_KEY).toList ();
     
    335335
    336336void
    337 TrMainWindow :: onSetPrefs (bool isChecked)
     337TrMainWindow::onSetPrefs (bool isChecked)
    338338{
    339339  if (isChecked)
     
    344344
    345345QWidget *
    346 TrMainWindow :: createStatusBar ()
     346TrMainWindow::createStatusBar ()
    347347{
    348348  QMenu * m;
     
    422422
    423423QMenu *
    424 TrMainWindow :: createOptionsMenu ()
     424TrMainWindow::createOptionsMenu ()
    425425{
    426426  QMenu * menu;
     
    510510
    511511void
    512 TrMainWindow :: setSortPref (int i)
     512TrMainWindow::setSortPref (int i)
    513513{
    514514  myPrefs.set (Prefs::SORT_MODE, SortMode (i));
    515515}
    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)
     516void TrMainWindow::onSortByActivityToggled (bool b) { if (b) setSortPref (SortMode::SORT_BY_ACTIVITY); }
     517void TrMainWindow::onSortByAgeToggled (bool b) { if (b) setSortPref (SortMode::SORT_BY_AGE); }
     518void TrMainWindow::onSortByETAToggled (bool b) { if (b) setSortPref (SortMode::SORT_BY_ETA); }
     519void TrMainWindow::onSortByNameToggled (bool b) { if (b) setSortPref (SortMode::SORT_BY_NAME); }
     520void TrMainWindow::onSortByProgressToggled (bool b) { if (b) setSortPref (SortMode::SORT_BY_PROGRESS); }
     521void TrMainWindow::onSortByQueueToggled (bool b) { if (b) setSortPref (SortMode::SORT_BY_QUEUE); }
     522void TrMainWindow::onSortByRatioToggled (bool b) { if (b) setSortPref (SortMode::SORT_BY_RATIO); }
     523void TrMainWindow::onSortBySizeToggled (bool b) { if (b) setSortPref (SortMode::SORT_BY_SIZE); }
     524void TrMainWindow::onSortByStateToggled (bool b) { if (b) setSortPref (SortMode::SORT_BY_STATE); }
     525
     526void
     527TrMainWindow::setSortAscendingPref (bool b)
    528528{
    529529  myPrefs.set (Prefs::SORT_REVERSED, b);
     
    535535
    536536void
    537 TrMainWindow :: showEvent (QShowEvent * event)
     537TrMainWindow::showEvent (QShowEvent * event)
    538538{
    539539  Q_UNUSED (event);
     
    547547
    548548void
    549 TrMainWindow :: hideEvent (QHideEvent * event)
     549TrMainWindow::hideEvent (QHideEvent * event)
    550550{
    551551  Q_UNUSED (event);
     
    560560
    561561void
    562 TrMainWindow :: onPrefsDestroyed ()
     562TrMainWindow::onPrefsDestroyed ()
    563563{
    564564  myPrefsDialog = 0;
     
    566566
    567567void
    568 TrMainWindow :: openPreferences ()
     568TrMainWindow::openPreferences ()
    569569{
    570570  if (myPrefsDialog == 0)
     
    578578
    579579void
    580 TrMainWindow :: onDetailsDestroyed ()
     580TrMainWindow::onDetailsDestroyed ()
    581581{
    582582  myDetailsDialog = 0;
     
    584584
    585585void
    586 TrMainWindow :: openProperties ()
     586TrMainWindow::openProperties ()
    587587{
    588588  if (myDetailsDialog == 0)
     
    597597
    598598void
    599 TrMainWindow :: setLocation ()
     599TrMainWindow::setLocation ()
    600600{
    601601  QDialog * d = new RelocateDialog (mySession, myModel, getSelectedTorrents (), this);
     
    635635
    636636void
    637 TrMainWindow :: openFolder ()
     637TrMainWindow::openFolder ()
    638638{
    639639  const int torrentId (*getSelectedTorrents ().begin ());
     
    654654    }
    655655#endif
    656   QDesktopServices :: openUrl (QUrl::fromLocalFile (path));
    657 }
    658 
    659 void
    660 TrMainWindow :: copyMagnetLinkToClipboard ()
     656  QDesktopServices::openUrl (QUrl::fromLocalFile (path));
     657}
     658
     659void
     660TrMainWindow::copyMagnetLinkToClipboard ()
    661661{
    662662  const int id (*getSelectedTorrents ().begin ());
     
    665665
    666666void
    667 TrMainWindow :: openDonate ()
    668 {
    669   QDesktopServices :: openUrl (QUrl ("http://www.transmissionbt.com/donate.php"));
    670 }
    671 
    672 void
    673 TrMainWindow :: openHelp ()
     667TrMainWindow::openDonate ()
     668{
     669  QDesktopServices::openUrl (QUrl ("http://www.transmissionbt.com/donate.php"));
     670}
     671
     672void
     673TrMainWindow::openHelp ()
    674674{
    675675  const char * fmt = "http://www.transmissionbt.com/help/gtk/%d.%dx";
     
    678678  char url[128];
    679679  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
     683void
     684TrMainWindow::refreshTitle ()
    685685{
    686686  QString title ("Transmission");
     
    692692
    693693void
    694 TrMainWindow :: refreshTrayIconSoon ()
     694TrMainWindow::refreshTrayIconSoon ()
    695695{
    696696  if (!myRefreshTrayIconTimer.isActive ())
     
    701701}
    702702void
    703 TrMainWindow :: refreshTrayIcon ()
     703TrMainWindow::refreshTrayIcon ()
    704704{
    705705  Speed upSpeed, downSpeed;
     
    731731
    732732void
    733 TrMainWindow :: refreshStatusBar ()
     733TrMainWindow::refreshStatusBar ()
    734734{
    735735  Speed upSpeed, downSpeed;
     
    774774
    775775void
    776 TrMainWindow :: refreshActionSensitivitySoon ()
     776TrMainWindow::refreshActionSensitivitySoon ()
    777777{
    778778  if (!myRefreshActionSensitivityTimer.isActive ())
     
    783783}
    784784void
    785 TrMainWindow :: refreshActionSensitivity ()
     785TrMainWindow::refreshActionSensitivity ()
    786786{
    787787  int selected (0);
     
    849849
    850850void
    851 TrMainWindow :: clearSelection ()
     851TrMainWindow::clearSelection ()
    852852{
    853853  ui.action_DeselectAll->trigger ();
     
    855855
    856856QSet<int>
    857 TrMainWindow :: getSelectedTorrents () const
     857TrMainWindow::getSelectedTorrents () const
    858858{
    859859  QSet<int> ids;
     
    869869
    870870void
    871 TrMainWindow :: startSelected ()
     871TrMainWindow::startSelected ()
    872872{
    873873  mySession.startTorrents (getSelectedTorrents ());
    874874}
    875875void
    876 TrMainWindow :: startSelectedNow ()
     876TrMainWindow::startSelectedNow ()
    877877{
    878878  mySession.startTorrentsNow (getSelectedTorrents ());
    879879}
    880880void
    881 TrMainWindow :: pauseSelected ()
     881TrMainWindow::pauseSelected ()
    882882{
    883883  mySession.pauseTorrents (getSelectedTorrents ());
    884884}
    885885void
    886 TrMainWindow :: queueMoveTop ()
     886TrMainWindow::queueMoveTop ()
    887887{
    888888  mySession.queueMoveTop (getSelectedTorrents ());
    889889}
    890890void
    891 TrMainWindow :: queueMoveUp ()
     891TrMainWindow::queueMoveUp ()
    892892{
    893893  mySession.queueMoveUp (getSelectedTorrents ());
    894894}
    895895void
    896 TrMainWindow :: queueMoveDown ()
     896TrMainWindow::queueMoveDown ()
    897897{
    898898  mySession.queueMoveDown (getSelectedTorrents ());
    899899}
    900900void
    901 TrMainWindow :: queueMoveBottom ()
     901TrMainWindow::queueMoveBottom ()
    902902{
    903903  mySession.queueMoveBottom (getSelectedTorrents ());
    904904}
    905905void
    906 TrMainWindow :: startAll ()
     906TrMainWindow::startAll ()
    907907{
    908908  mySession.startTorrents ();
    909909}
    910910void
    911 TrMainWindow :: pauseAll ()
     911TrMainWindow::pauseAll ()
    912912{
    913913  mySession.pauseTorrents ();
    914914}
    915915void
    916 TrMainWindow :: removeSelected ()
     916TrMainWindow::removeSelected ()
    917917{
    918918  removeTorrents (false);
    919919}
    920920void
    921 TrMainWindow :: deleteSelected ()
     921TrMainWindow::deleteSelected ()
    922922{
    923923  removeTorrents (true);
    924924}
    925925void
    926 TrMainWindow :: verifySelected ()
     926TrMainWindow::verifySelected ()
    927927{
    928928  mySession.verifyTorrents (getSelectedTorrents ());
    929929}
    930930void
    931 TrMainWindow :: reannounceSelected ()
     931TrMainWindow::reannounceSelected ()
    932932{
    933933  mySession.reannounceTorrents (getSelectedTorrents ());
     
    938938**/
    939939
    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"); }
     940void TrMainWindow::showTotalRatio () { myPrefs.set (Prefs::STATUSBAR_STATS, "total-ratio"); }
     941void TrMainWindow::showTotalTransfer () { myPrefs.set (Prefs::STATUSBAR_STATS, "total-transfer"); }
     942void TrMainWindow::showSessionRatio () { myPrefs.set (Prefs::STATUSBAR_STATS, "session-ratio"); }
     943void TrMainWindow::showSessionTransfer () { myPrefs.set (Prefs::STATUSBAR_STATS, "session-transfer"); }
    944944
    945945/**
     
    948948
    949949void
    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);
     950TrMainWindow::setCompactView (bool visible)
     951{
     952  myPrefs.set (Prefs::COMPACT_VIEW, visible);
     953}
     954void
     955TrMainWindow::toggleSpeedMode ()
     956{
     957  myPrefs.toggleBool (Prefs::ALT_SPEED_LIMIT_ENABLED);
    958958  const bool mode = myPrefs.get<bool> (Prefs::ALT_SPEED_LIMIT_ENABLED);
    959959  myAltSpeedAction->setIcon (mode ? mySpeedModeOnIcon : mySpeedModeOffIcon);
    960960}
    961961void
    962 TrMainWindow :: setToolbarVisible (bool visible)
     962TrMainWindow::setToolbarVisible (bool visible)
    963963{
    964964  myPrefs.set (Prefs::TOOLBAR, visible);
    965965}
    966966void
    967 TrMainWindow :: setFilterbarVisible (bool visible)
     967TrMainWindow::setFilterbarVisible (bool visible)
    968968{
    969969  myPrefs.set (Prefs::FILTERBAR, visible);
    970970}
    971971void
    972 TrMainWindow :: setStatusbarVisible (bool visible)
     972TrMainWindow::setStatusbarVisible (bool visible)
    973973{
    974974  myPrefs.set (Prefs::STATUSBAR, visible);
     
    980980
    981981void
    982 TrMainWindow :: toggleWindows (bool doShow)
     982TrMainWindow::toggleWindows (bool doShow)
    983983{
    984984  if (!doShow)
     
    997997
    998998void
    999 TrMainWindow :: trayActivated (QSystemTrayIcon::ActivationReason reason)
     999TrMainWindow::trayActivated (QSystemTrayIcon::ActivationReason reason)
    10001000{
    10011001  if ((reason == QSystemTrayIcon::Trigger) ||
     
    10111011
    10121012void
    1013 TrMainWindow :: refreshPref (int key)
     1013TrMainWindow::refreshPref (int key)
    10141014{
    10151015  bool b;
     
    11191119        break;
    11201120
    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:
    11241124        {
    1125           b = myPrefs.getBool (Prefs :: ALT_SPEED_LIMIT_ENABLED);
     1125          b = myPrefs.getBool (Prefs::ALT_SPEED_LIMIT_ENABLED);
    11261126          myAltSpeedButton->setChecked (b);
    11271127          myAltSpeedButton->setIcon (b ? mySpeedModeOnIcon : mySpeedModeOffIcon);
     
    11471147
    11481148void
    1149 TrMainWindow :: newTorrent ()
     1149TrMainWindow::newTorrent ()
    11501150{
    11511151  MakeDialog * dialog = new MakeDialog (mySession, this);
     
    11541154
    11551155void
    1156 TrMainWindow :: openTorrent ()
     1156TrMainWindow::openTorrent ()
    11571157{
    11581158  QFileDialog * d;
     
    11821182
    11831183void
    1184 TrMainWindow :: openURL ()
     1184TrMainWindow::openURL ()
    11851185{
    11861186  QString str = QApplication::clipboard ()->text (QClipboard::Selection);
     
    11961196
    11971197void
    1198 TrMainWindow :: addTorrents (const QStringList& filenames)
     1198TrMainWindow::addTorrents (const QStringList& filenames)
    11991199{
    12001200  bool showOptions = myPrefs.getBool (Prefs::OPTIONS_PROMPT);
     
    12131213
    12141214void
    1215 TrMainWindow :: addTorrent (const AddData& addMe, bool showOptions)
     1215TrMainWindow::addTorrent (const AddData& addMe, bool showOptions)
    12161216{
    12171217  if (showOptions)
     
    12191219      Options * o = new Options (mySession, myPrefs, addMe, this);
    12201220      o->show ();
    1221       QApplication :: alert (o);
     1221      QApplication::alert (o);
    12221222    }
    12231223  else
    12241224    {
    12251225      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
     1230void
     1231TrMainWindow::removeTorrents (const bool deleteFiles)
    12321232{
    12331233  QSet<int> ids;
     
    13361336
    13371337void
    1338 TrMainWindow :: updateNetworkIcon ()
     1338TrMainWindow::updateNetworkIcon ()
    13391339{
    13401340  const time_t now = time (NULL);
     
    13771377
    13781378void
    1379 TrMainWindow :: onNetworkTimer ()
     1379TrMainWindow::onNetworkTimer ()
    13801380{
    13811381  updateNetworkIcon ();
     
    13831383
    13841384void
    1385 TrMainWindow :: dataReadProgress ()
     1385TrMainWindow::dataReadProgress ()
    13861386{
    13871387  if (!myNetworkError)
     
    13901390
    13911391void
    1392 TrMainWindow :: dataSendProgress ()
     1392TrMainWindow::dataSendProgress ()
    13931393{
    13941394  myLastSendTime = time (NULL);
     
    13961396
    13971397void
    1398 TrMainWindow :: onError (QNetworkReply::NetworkError code)
     1398TrMainWindow::onError (QNetworkReply::NetworkError code)
    13991399{
    14001400  const bool hadError = myNetworkError;
     
    14131413
    14141414void
    1415 TrMainWindow :: errorMessage (const QString msg)
     1415TrMainWindow::errorMessage (const QString msg)
    14161416{
    14171417    myErrorMessage = msg;
     
    14191419
    14201420void
    1421 TrMainWindow :: wrongAuthentication ()
     1421TrMainWindow::wrongAuthentication ()
    14221422{
    14231423  mySession.stop ();
     
    14301430
    14311431void
    1432 TrMainWindow :: dragEnterEvent (QDragEnterEvent * event)
     1432TrMainWindow::dragEnterEvent (QDragEnterEvent * event)
    14331433{
    14341434  const QMimeData * mime = event->mimeData ();
     
    14421442
    14431443void
    1444 TrMainWindow :: dropEvent (QDropEvent * event)
     1444TrMainWindow::dropEvent (QDropEvent * event)
    14451445{
    14461446  QStringList list;
     
    14771477
    14781478void
    1479 TrMainWindow :: contextMenuEvent (QContextMenuEvent * event)
     1479TrMainWindow::contextMenuEvent (QContextMenuEvent * event)
    14801480{
    14811481  QMenu * menu = new QMenu (this);
  • trunk/qt/make-dialog.cc

    r14225 r14377  
    4444
    4545void
    46 MakeDialog :: onNewDialogDestroyed (QObject * o)
     46MakeDialog::onNewDialogDestroyed (QObject * o)
    4747{
    4848  Q_UNUSED (o);
     
    5252
    5353void
    54 MakeDialog :: onNewButtonBoxClicked (QAbstractButton * button)
     54MakeDialog::onNewButtonBoxClicked (QAbstractButton * button)
    5555{
    5656  switch (myNewButtonBox->standardButton (button))
     
    7272
    7373void
    74 MakeDialog :: onProgress ()
     74MakeDialog::onProgress ()
    7575{
    7676  // progress bar
     
    105105
    106106void
    107 MakeDialog :: makeTorrent ()
     107MakeDialog::makeTorrent ()
    108108{
    109109  if (!myBuilder)
     
    173173
    174174void
    175 MakeDialog :: onFileClicked ()
     175MakeDialog::onFileClicked ()
    176176{
    177177  QFileDialog * d = new QFileDialog (this, tr ("Select File"));
     
    183183}
    184184void
    185 MakeDialog :: onFileSelected (const QStringList& list)
     185MakeDialog::onFileSelected (const QStringList& list)
    186186{
    187187  if (!list.empty ())
     
    189189}
    190190void
    191 MakeDialog :: onFileSelected (const QString& filename)
     191MakeDialog::onFileSelected (const QString& filename)
    192192{
    193193  myFile = Utils::removeTrailingDirSeparator (filename);
     
    197197
    198198void
    199 MakeDialog :: onFolderClicked ()
     199MakeDialog::onFolderClicked ()
    200200{
    201201  QFileDialog * d = new QFileDialog (this, tr ("Select Folder"));
     
    209209
    210210void
    211 MakeDialog :: onFolderSelected (const QStringList& list)
     211MakeDialog::onFolderSelected (const QStringList& list)
    212212{
    213213  if (!list.empty ())
     
    216216
    217217void
    218 MakeDialog :: onFolderSelected (const QString& filename)
     218MakeDialog::onFolderSelected (const QString& filename)
    219219{
    220220  myFolder = Utils::removeTrailingDirSeparator (filename);
     
    224224
    225225void
    226 MakeDialog :: onDestinationClicked ()
     226MakeDialog::onDestinationClicked ()
    227227{
    228228  QFileDialog * d = new QFileDialog (this, tr ("Select Folder"));
     
    235235}
    236236void
    237 MakeDialog :: onDestinationSelected (const QStringList& list)
     237MakeDialog::onDestinationSelected (const QStringList& list)
    238238{
    239239  if (!list.empty ())
     
    241241}
    242242void
    243 MakeDialog :: onDestinationSelected (const QString& filename)
     243MakeDialog::onDestinationSelected (const QString& filename)
    244244{
    245245  myDestination = Utils::removeTrailingDirSeparator (filename);
     
    248248
    249249void
    250 MakeDialog :: enableBuddyWhenChecked (QRadioButton * box, QWidget * buddy)
     250MakeDialog::enableBuddyWhenChecked (QRadioButton * box, QWidget * buddy)
    251251{
    252252  connect (box, SIGNAL(toggled(bool)), buddy, SLOT(setEnabled(bool)));
     
    254254}
    255255void
    256 MakeDialog :: enableBuddyWhenChecked (QCheckBox * box, QWidget * buddy)
     256MakeDialog::enableBuddyWhenChecked (QCheckBox * box, QWidget * buddy)
    257257{
    258258  connect (box, SIGNAL(toggled(bool)), buddy, SLOT(setEnabled(bool)));
     
    261261
    262262QString
    263 MakeDialog :: getSource () const
     263MakeDialog::getSource () const
    264264{
    265265  return myFileRadio->isChecked () ? myFile : myFolder;
     
    267267
    268268void
    269 MakeDialog :: onButtonBoxClicked (QAbstractButton * button)
     269MakeDialog::onButtonBoxClicked (QAbstractButton * button)
    270270{
    271271  switch (myButtonBox->standardButton (button))
     
    286286
    287287void
    288 MakeDialog :: onSourceChanged ()
     288MakeDialog::onSourceChanged ()
    289289{
    290290  if (myBuilder)
     
    328328};
    329329
    330 MakeDialog :: MakeDialog (Session & session, QWidget * parent):
     330MakeDialog::MakeDialog (Session& session, QWidget * parent):
    331331  QDialog (parent, Qt::Dialog),
    332332  mySession (session),
     
    339339  setWindowTitle (tr ("New Torrent"));
    340340  QVBoxLayout * top = new QVBoxLayout (this);
    341   top->setSpacing (HIG :: PAD);
     341  top->setSpacing (HIG::PAD);
    342342
    343343  HIG * hig = new HIG;
     
    420420}
    421421
    422 MakeDialog :: ~MakeDialog ()
     422MakeDialog::~MakeDialog ()
    423423{
    424424  if (myBuilder)
     
    431431
    432432void
    433 MakeDialog :: dragEnterEvent (QDragEnterEvent * event)
     433MakeDialog::dragEnterEvent (QDragEnterEvent * event)
    434434{
    435435  const QMimeData * mime = event->mimeData ();
     
    440440
    441441void
    442 MakeDialog :: dropEvent (QDropEvent * event)
     442MakeDialog::dropEvent (QDropEvent * event)
    443443{
    444444  const QString filename = event->mimeData()->urls().front().path();
  • trunk/qt/options.cc

    r14349 r14377  
    4444***/
    4545
    46 Options :: Options (Session& session, const Prefs& prefs, const AddData& addme, QWidget * parent):
     46Options::Options (Session& session, const Prefs& prefs, const AddData& addme, QWidget * parent):
    4747  QDialog (parent, Qt::Dialog),
    4848  mySession (session),
     
    7373  connect (&myEditTimer, SIGNAL (timeout ()), this, SLOT (onDestinationEditedIdle ()));
    7474
    75   const int iconSize (style ()->pixelMetric (QStyle :: PM_SmallIconSize));
     75  const int iconSize (style ()->pixelMetric (QStyle::PM_SmallIconSize));
    7676  QIcon fileIcon = style ()->standardIcon (QStyle::SP_FileIcon);
    7777  const QPixmap filePixmap = fileIcon.pixmap (iconSize);
     
    164164  QCheckBox * c;
    165165  c = myStartCheck = new QCheckBox (tr ("S&tart when added"));
    166   c->setChecked (prefs.getBool (Prefs :: START));
     166  c->setChecked (prefs.getBool (Prefs::START));
    167167  layout->addWidget (c, ++row, 0, 1, 2, Qt::AlignLeft);
    168168
    169169  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));
    171171  layout->addWidget (c, ++row, 0, 1, 2, Qt::AlignLeft);
    172172
     
    178178  layout->setRowStretch (3, 2);
    179179  layout->setColumnStretch (1, 2);
    180   layout->setSpacing (HIG :: PAD);
     180  layout->setSpacing (HIG::PAD);
    181181
    182182  connect (myTree, SIGNAL (priorityChanged (const QSet<int>&,int)), this, SLOT (onPriorityChanged (const QSet<int>&,int)));
     
    190190}
    191191
    192 Options :: ~Options ()
     192Options::~Options ()
    193193{
    194194  clearInfo ();
     
    200200
    201201void
    202 Options :: refreshButton (QPushButton * p, const QString& text, int width)
     202Options::refreshButton (QPushButton * p, const QString& text, int width)
    203203{
    204204  if (width <= 0)
     
    211211
    212212void
    213 Options :: refreshSource (int width)
     213Options::refreshSource (int width)
    214214{
    215215  QString text = myAdd.readableName ();
     
    223223
    224224void
    225 Options :: refreshDestinationButton (int width)
     225Options::refreshDestinationButton (int width)
    226226{
    227227  if (myDestinationButton != 0)
     
    231231
    232232bool
    233 Options :: eventFilter (QObject * o, QEvent * event)
     233Options::eventFilter (QObject * o, QEvent * event)
    234234{
    235235  if (event->type() == QEvent::Resize)
     
    250250
    251251void
    252 Options :: clearInfo ()
     252Options::clearInfo ()
    253253{
    254254  if (myHaveInfo)
     
    260260
    261261void
    262 Options :: reload ()
     262Options::reload ()
    263263{
    264264  clearInfo ();
     
    320320
    321321void
    322 Options :: onPriorityChanged (const QSet<int>& fileIndices, int priority)
     322Options::onPriorityChanged (const QSet<int>& fileIndices, int priority)
    323323{
    324324  foreach (int i, fileIndices)
     
    327327
    328328void
    329 Options :: onWantedChanged (const QSet<int>& fileIndices, bool isWanted)
     329Options::onWantedChanged (const QSet<int>& fileIndices, bool isWanted)
    330330{
    331331  foreach (int i, fileIndices)
     
    334334
    335335void
    336 Options :: onAccepted ()
     336Options::onAccepted ()
    337337{
    338338  // rpc spec section 3.4 "adding a torrent"
     
    396396
    397397void
    398 Options :: onFilenameClicked ()
     398Options::onFilenameClicked ()
    399399{
    400400  if (myAdd.type == AddData::FILENAME)
     
    412412
    413413void
    414 Options :: onFilesSelected (const QStringList& files)
     414Options::onFilesSelected (const QStringList& files)
    415415{
    416416  if (files.size () == 1)
     
    423423
    424424void
    425 Options :: onSourceEditingFinished ()
     425Options::onSourceEditingFinished ()
    426426{
    427427  myAdd.set (mySourceEdit->text());
     
    429429
    430430void
    431 Options :: onDestinationClicked ()
     431Options::onDestinationClicked ()
    432432{
    433433  QFileDialog * d = new QFileDialog (this, tr ("Select Destination"), myLocalDestination.absolutePath ());
     
    439439
    440440void
    441 Options :: onDestinationsSelected (const QStringList& destinations)
     441Options::onDestinationsSelected (const QStringList& destinations)
    442442{
    443443  if (destinations.size () == 1)
     
    451451
    452452void
    453 Options :: onDestinationEdited (const QString& text)
     453Options::onDestinationEdited (const QString& text)
    454454{
    455455  Q_UNUSED (text);
     
    459459
    460460void
    461 Options :: onDestinationEditedIdle ()
     461Options::onDestinationEditedIdle ()
    462462{
    463463  myFreespaceLabel->setPath (myDestinationEdit->text());
     
    471471
    472472void
    473 Options :: clearVerify ()
     473Options::clearVerify ()
    474474{
    475475  myVerifyHash.reset ();
     
    489489
    490490void
    491 Options :: onVerify ()
     491Options::onVerify ()
    492492{
    493493  clearVerify ();
     
    508508
    509509void
    510 Options :: onTimeout ()
     510Options::onTimeout ()
    511511{
    512512  if (myFiles.isEmpty())
  • trunk/qt/prefs-dialog.cc

    r14329 r14377  
    5252
    5353void
    54 PrefsDialog :: checkBoxToggled (bool checked)
     54PrefsDialog::checkBoxToggled (bool checked)
    5555{
    5656  const int key (sender ()->property (PREF_KEY).toInt ());
     
    5959
    6060QCheckBox *
    61 PrefsDialog :: checkBoxNew (const QString& text, int key)
     61PrefsDialog::checkBoxNew (const QString& text, int key)
    6262{
    6363  QCheckBox * box = new QCheckBox (text);
     
    7070
    7171void
    72 PrefsDialog :: enableBuddyWhenChecked (QCheckBox * box, QWidget * buddy)
     72PrefsDialog::enableBuddyWhenChecked (QCheckBox * box, QWidget * buddy)
    7373{
    7474  connect (box, SIGNAL(toggled(bool)), buddy, SLOT(setEnabled(bool)));
     
    7777
    7878void
    79 PrefsDialog :: spinBoxEditingFinished()
     79PrefsDialog::spinBoxEditingFinished ()
    8080{
    8181  const QObject * spin = sender();
     
    9090
    9191QSpinBox *
    92 PrefsDialog :: spinBoxNew (int key, int low, int high, int step)
     92PrefsDialog::spinBoxNew (int key, int low, int high, int step)
    9393{
    9494  QSpinBox * spin = new QSpinBox ();
     
    103103
    104104QDoubleSpinBox *
    105 PrefsDialog :: doubleSpinBoxNew (int key, double low, double high, double step, int decimals)
     105PrefsDialog::doubleSpinBoxNew (int key, double low, double high, double step, int decimals)
    106106{
    107107  QDoubleSpinBox * spin = new QDoubleSpinBox ();
     
    143143
    144144void
    145 PrefsDialog :: lineEditingFinished ()
     145PrefsDialog::lineEditingFinished ()
    146146{
    147147  QLineEdit * e = qobject_cast<QLineEdit*>(sender());
     
    155155
    156156QLineEdit*
    157 PrefsDialog :: lineEditNew (int key, int echoMode)
     157PrefsDialog::lineEditNew (int key, int echoMode)
    158158{
    159159  QLineEdit * e = new QLineEdit (myPrefs.getString (key));
     
    170170
    171171QWidget *
    172 PrefsDialog :: createRemoteTab (Session& session)
     172PrefsDialog::createRemoteTab (Session& session)
    173173{
    174174  HIG * hig = new HIG (this);
     
    204204
    205205void
    206 PrefsDialog :: altSpeedDaysEdited (int i)
     206PrefsDialog::altSpeedDaysEdited (int i)
    207207{
    208208  const int value = qobject_cast<QComboBox*>(sender())->itemData(i).toInt();
     
    212212
    213213QWidget *
    214 PrefsDialog :: createSpeedTab ()
     214PrefsDialog::createSpeedTab ()
    215215{
    216216  QWidget *l, *r;
     
    231231  hig->addSectionDivider ();
    232232  QHBoxLayout * h = new QHBoxLayout;
    233   h->setSpacing (HIG :: PAD);
     233  h->setSpacing (HIG::PAD);
    234234  QLabel * label = new QLabel;
    235235  label->setPixmap (QPixmap (QString::fromUtf8 (":/icons/alt-limit-off.png")));
     
    246246
    247247    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);
    249249    hig->addRow (s, r);
    250250
    251251    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);
    253253    hig->addRow (s, r);
    254254
     
    256256    h = new QHBoxLayout ();
    257257    h->setSpacing (HIG::PAD);
    258     QWidget * w = timeEditNew (Prefs :: ALT_SPEED_LIMIT_TIME_BEGIN);
     258    QWidget * w = timeEditNew (Prefs::ALT_SPEED_LIMIT_TIME_BEGIN);
    259259    h->addWidget (w, 1);
    260260    mySchedWidgets << w;
     
    262262    h->addWidget (nd);
    263263    mySchedWidgets << nd;
    264     w = timeEditNew (Prefs :: ALT_SPEED_LIMIT_TIME_END);
     264    w = timeEditNew (Prefs::ALT_SPEED_LIMIT_TIME_END);
    265265    nd->setBuddy (w);
    266266    h->addWidget (w, 1);
     
    281281    box->addItem (noIcon, tr ("Friday"),    QVariant (TR_SCHED_FRI));
    282282    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)));
    284284    connect (box, SIGNAL(activated(int)), this, SLOT(altSpeedDaysEdited(int)));
    285285    w = hig->addRow (s, box);
     
    295295
    296296QWidget *
    297 PrefsDialog :: createDesktopTab ()
     297PrefsDialog::createDesktopTab ()
    298298{
    299299  HIG * hig = new HIG (this);
     
    319319
    320320void
    321 PrefsDialog :: onPortTested (bool isOpen)
     321PrefsDialog::onPortTested (bool isOpen)
    322322{
    323323  myPortButton->setEnabled (true);
     
    328328
    329329void
    330 PrefsDialog :: onPortTest ()
     330PrefsDialog::onPortTest ()
    331331{
    332332  myPortLabel->setText (tr ("Testing TCP Port..."));
     
    337337
    338338QWidget *
    339 PrefsDialog :: createNetworkTab ()
     339PrefsDialog::createNetworkTab ()
    340340{
    341341  HIG * hig = new HIG (this);
     
    347347  QLabel * l = myPortLabel = new QLabel (tr ("Status unknown"));
    348348  h->addWidget (l);
    349   h->addSpacing (HIG :: PAD_BIG);
     349  h->addSpacing (HIG::PAD_BIG);
    350350  h->addWidget (b);
    351351  h->setStretchFactor (l, 1);
     
    355355  hig->addRow (tr ("&Port for incoming connections:"), s);
    356356  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));
    358358  hig->addWideControl (checkBoxNew (tr ("Use UPnP or NAT-PMP port &forwarding from my router"), Prefs::PORT_FORWARDING));
    359359
     
    385385
    386386void
    387 PrefsDialog :: onBlocklistDialogDestroyed (QObject * o)
     387PrefsDialog::onBlocklistDialogDestroyed (QObject * o)
    388388{
    389389  Q_UNUSED (o);
     
    393393
    394394void
    395 PrefsDialog :: onUpdateBlocklistCancelled ()
     395PrefsDialog::onUpdateBlocklistCancelled ()
    396396{
    397397  disconnect (&mySession, SIGNAL(blocklistUpdated(int)), this, SLOT(onBlocklistUpdated(int)));
     
    400400
    401401void
    402 PrefsDialog :: onBlocklistUpdated (int n)
     402PrefsDialog::onBlocklistUpdated (int n)
    403403{
    404404  myBlocklistDialog->setText (tr ("<b>Update succeeded!</b><p>Blocklist now has %Ln rules.", 0, n));
     
    407407
    408408void
    409 PrefsDialog :: onUpdateBlocklistClicked ()
     409PrefsDialog::onUpdateBlocklistClicked ()
    410410{
    411411  myBlocklistDialog = new QMessageBox (QMessageBox::Information,
     
    421421
    422422void
    423 PrefsDialog :: encryptionEdited (int i)
     423PrefsDialog::encryptionEdited (int i)
    424424{
    425425  const int value (qobject_cast<QComboBox*>(sender())->itemData(i).toInt ());
     
    428428
    429429QWidget *
    430 PrefsDialog :: createPrivacyTab ()
     430PrefsDialog::createPrivacyTab ()
    431431{
    432432  QWidget * w;
     
    439439  box->addItem (tr ("Prefer encryption"), 1);
    440440  box->addItem (tr ("Require encryption"), 2);
    441   myWidgets.insert (Prefs :: ENCRYPTION, box);
     441  myWidgets.insert (Prefs::ENCRYPTION, box);
    442442  connect (box, SIGNAL(activated(int)), this, SLOT(encryptionEdited(int)));
    443443
     
    477477
    478478void
    479 PrefsDialog :: onScriptClicked (void)
     479PrefsDialog::onScriptClicked (void)
    480480{
    481481  const QString title = tr ("Select \"Torrent Done\" Script");
     
    488488
    489489void
    490 PrefsDialog :: onIncompleteClicked (void)
     490PrefsDialog::onIncompleteClicked (void)
    491491{
    492492  const QString title = tr ("Select Incomplete Directory");
     
    499499
    500500void
    501 PrefsDialog :: onWatchClicked (void)
     501PrefsDialog::onWatchClicked (void)
    502502{
    503503  const QString title = tr ("Select Watch Directory");
     
    510510
    511511void
    512 PrefsDialog :: onDestinationClicked (void)
     512PrefsDialog::onDestinationClicked (void)
    513513{
    514514  const QString title = tr ("Select Destination");
     
    521521
    522522void
    523 PrefsDialog :: onLocationSelected (const QString& path, int key)
     523PrefsDialog::onLocationSelected (const QString& path, int key)
    524524{
    525525  setPref (key, path);
     
    527527
    528528QWidget *
    529 PrefsDialog :: createSeedingTab ()
    530 {
    531   const int iconSize (style ()->pixelMetric (QStyle :: PM_SmallIconSize));
     529PrefsDialog::createSeedingTab ()
     530{
     531  const int iconSize (style ()->pixelMetric (QStyle::PM_SmallIconSize));
    532532  const QFileIconProvider iconProvider;
    533533  const QIcon folderIcon = iconProvider.icon (QFileIconProvider::Folder);
     
    555555
    556556QWidget *
    557 PrefsDialog :: createDownloadingTab ()
    558 {
    559   const int iconSize (style ()->pixelMetric (QStyle :: PM_SmallIconSize));
     557PrefsDialog::createDownloadingTab ()
     558{
     559  const int iconSize (style ()->pixelMetric (QStyle::PM_SmallIconSize));
    560560  const QFileIconProvider iconProvider;
    561561  const QIcon folderIcon = iconProvider.icon (QFileIconProvider::Folder);
     
    631631***/
    632632
    633 PrefsDialog :: PrefsDialog (Session& session, Prefs& prefs, QWidget * parent):
     633PrefsDialog::PrefsDialog (Session& session, Prefs& prefs, QWidget * parent):
    634634  QDialog (parent),
    635635  myIsServer (session.isServer ()),
     
    658658
    659659  QList<int> keys;
    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;
     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;
    670670  foreach (int key, keys)
    671671    refreshPref (key);
     
    683683}
    684684
    685 PrefsDialog :: ~PrefsDialog ()
    686 {
    687 }
    688 
    689 void
    690 PrefsDialog :: setPref (int key, const QVariant& v)
     685PrefsDialog::~PrefsDialog ()
     686{
     687}
     688
     689void
     690PrefsDialog::setPref (int key, const QVariant& v)
    691691{
    692692  myPrefs.set (key, v);
     
    699699
    700700void
    701 PrefsDialog :: sessionUpdated ()
     701PrefsDialog::sessionUpdated ()
    702702{
    703703  updateBlocklistLabel ();
     
    705705
    706706void
    707 PrefsDialog :: updateBlocklistLabel ()
     707PrefsDialog::updateBlocklistLabel ()
    708708{
    709709  const int n = mySession.blocklistSize ();
     
    712712
    713713void
    714 PrefsDialog :: refreshPref (int key)
     714PrefsDialog::refreshPref (int key)
    715715{
    716716  switch (key)
    717717    {
    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:
    721721        {
    722722          const bool enabled (myPrefs.getBool (Prefs::RPC_ENABLED));
     
    729729        }
    730730
    731       case Prefs :: ALT_SPEED_LIMIT_TIME_ENABLED:
     731      case Prefs::ALT_SPEED_LIMIT_TIME_ENABLED:
    732732        {
    733733          const bool enabled = myPrefs.getBool (key);
     
    736736        }
    737737
    738       case Prefs :: BLOCKLIST_ENABLED:
     738      case Prefs::BLOCKLIST_ENABLED:
    739739        {
    740740          const bool enabled = myPrefs.getBool (key);
     
    743743        }
    744744
    745       case Prefs :: DIR_WATCH:
     745      case Prefs::DIR_WATCH:
    746746        myWatchButton->setText (QFileInfo(myPrefs.getString(Prefs::DIR_WATCH)).fileName());
    747747        break;
    748748
    749       case Prefs :: SCRIPT_TORRENT_DONE_FILENAME:
     749      case Prefs::SCRIPT_TORRENT_DONE_FILENAME:
    750750        {
    751751          const QString path (myPrefs.getString (key));
     
    754754        }
    755755
    756       case Prefs :: PEER_PORT:
     756      case Prefs::PEER_PORT:
    757757        myPortLabel->setText (tr ("Status unknown"));
    758758        myPortButton->setEnabled (true);
    759759        break;
    760760
    761       case Prefs :: DOWNLOAD_DIR:
     761      case Prefs::DOWNLOAD_DIR:
    762762        {
    763763          const QString path (myPrefs.getString (key));
     
    767767        }
    768768
    769       case Prefs :: INCOMPLETE_DIR:
     769      case Prefs::INCOMPLETE_DIR:
    770770        {
    771771          QString path (myPrefs.getString (key));
     
    774774        }
    775775
    776       case Prefs :: INCOMPLETE_DIR_ENABLED:
     776      case Prefs::INCOMPLETE_DIR_ENABLED:
    777777        {
    778778          const bool enabled = myPrefs.getBool (key);
     
    826826
    827827bool
    828 PrefsDialog :: isAllowed (int key) const
     828PrefsDialog::isAllowed (int key) const
    829829{
    830830  Q_UNUSED (key);
  • trunk/qt/prefs.cc

    r14225 r14377  
    126126***/
    127127
    128 Prefs :: Prefs (const char * configDir):
     128Prefs::Prefs (const char * configDir):
    129129  myConfigDir (QString::fromUtf8 (configDir))
    130130{
     
    188188          case QVariant::DateTime:
    189189            if (tr_variantGetInt (b, &intVal))
    190                 myValues[i].setValue (QDateTime :: fromTime_t (intVal));
     190                myValues[i].setValue (QDateTime::fromTime_t (intVal));
    191191            break;
    192192
     
    200200}
    201201
    202 Prefs :: ~Prefs ()
     202Prefs::~Prefs ()
    203203{
    204204  // make a dict from settings.json
     
    274274 */
    275275void
    276 Prefs :: initDefaults (tr_variant * d)
     276Prefs::initDefaults (tr_variant * d)
    277277{
    278278  tr_variantDictReserve (d, 38);
     
    322322
    323323bool
    324 Prefs :: getBool (int key) const
     324Prefs::getBool (int key) const
    325325{
    326326  assert (myItems[key].type == QVariant::Bool);
     
    329329
    330330QString
    331 Prefs :: getString (int key) const
     331Prefs::getString (int key) const
    332332{
    333333  assert (myItems[key].type == QVariant::String);
     
    339339
    340340int
    341 Prefs :: getInt (int key) const
     341Prefs::getInt (int key) const
    342342{
    343343  assert (myItems[key].type == QVariant::Int);
     
    346346
    347347double
    348 Prefs :: getDouble (int key) const
     348Prefs::getDouble (int key) const
    349349{
    350350  assert (myItems[key].type == QVariant::Double);
     
    353353
    354354QDateTime
    355 Prefs :: getDateTime (int key) const
     355Prefs::getDateTime (int key) const
    356356{
    357357  assert (myItems[key].type == QVariant::DateTime);
     
    364364
    365365void
    366 Prefs :: toggleBool (int key)
     366Prefs::toggleBool (int key)
    367367{
    368368  set (key, !getBool(key));
  • trunk/qt/relocate.cc

    r14225 r14377  
    2727#include "utils.h"
    2828
    29 bool RelocateDialog :: myMoveFlag = true;
     29bool RelocateDialog::myMoveFlag = true;
    3030
    3131void
    32 RelocateDialog :: onSetLocation ()
     32RelocateDialog::onSetLocation ()
    3333{
    3434  mySession.torrentSetLocation (myIds, myPath, myMoveFlag);
     
    3737
    3838void
    39 RelocateDialog :: onFileSelected (const QString& path)
     39RelocateDialog::onFileSelected (const QString& path)
    4040{
    4141  myPath = path;
     
    4444
    4545void
    46 RelocateDialog :: onDirButtonClicked ()
     46RelocateDialog::onDirButtonClicked ()
    4747{
    4848  const QString title = tr ("Select Location");
     
    5454
    5555void
    56 RelocateDialog :: onMoveToggled (bool b)
     56RelocateDialog::onMoveToggled (bool b)
    5757{
    5858  myMoveFlag = b;
    5959}
    6060
    61 RelocateDialog :: RelocateDialog (Session          & session,
    62                                   TorrentModel     & model,
    63                                   const QSet<int>  & ids,
    64                                   QWidget          * parent):
     61RelocateDialog::RelocateDialog (Session          & session,
     62                                TorrentModel     & model,
     63                                const QSet<int>  & ids,
     64                                QWidget          * parent):
    6565  QDialog (parent),
    6666  mySession (session),
     
    6868  myIds (ids)
    6969{
    70   const int iconSize (style ()->pixelMetric (QStyle :: PM_SmallIconSize));
     70  const int iconSize (style ()->pixelMetric (QStyle::PM_SmallIconSize));
    7171  const QFileIconProvider iconProvider;
    7272  const QIcon folderIcon = iconProvider.icon (QFileIconProvider::Folder);
  • trunk/qt/session-dialog.cc

    r14225 r14377  
    2626
    2727void
    28 SessionDialog :: onAccepted ()
     28SessionDialog::onAccepted ()
    2929{
    3030  myPrefs.set (Prefs::SESSION_IS_REMOTE, myRemoteRadioButton->isChecked ());
     
    3939
    4040void
    41 SessionDialog :: resensitize ()
     41SessionDialog::resensitize ()
    4242{
    4343  const bool isRemote = myRemoteRadioButton->isChecked();
     
    5555***/
    5656
    57 SessionDialog :: SessionDialog (Session& session, Prefs& prefs, QWidget * parent):
     57SessionDialog::SessionDialog (Session& session, Prefs& prefs, QWidget * parent):
    5858  QDialog (parent),
    5959  mySession (session),
     
    6868  setWindowTitle (tr ("Change Session"));
    6969  QVBoxLayout * top = new QVBoxLayout (this);
    70   top->setSpacing (HIG :: PAD);
     70  top->setSpacing (HIG::PAD);
    7171
    7272  HIG * hig = new HIG;
  • trunk/qt/session.cc

    r14349 r14377  
    9090
    9191void
    92 FileAdded :: executed (int64_t tag, const QString& result, struct tr_variant * arguments)
     92FileAdded::executed (int64_t tag, const QString& result, struct tr_variant * arguments)
    9393{
    9494  Q_UNUSED (arguments);
     
    127127
    128128void
    129 Session :: sessionSet (const tr_quark key, const QVariant& value)
     129Session::sessionSet (const tr_quark key, const QVariant& value)
    130130{
    131131  tr_variant top;
     
    146146
    147147void
    148 Session :: portTest ()
     148Session::portTest ()
    149149{
    150150  tr_variant top;
     
    157157
    158158void
    159 Session :: copyMagnetLinkToClipboard (int torrentId)
     159Session::copyMagnetLinkToClipboard (int torrentId)
    160160{
    161161  tr_variant top;
     
    171171
    172172void
    173 Session :: updatePref (int key)
     173Session::updatePref (int key)
    174174{
    175175  if (myPrefs.isCore (key)) switch (key)
    176176    {
    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:
    212212        sessionSet (myPrefs.getKey (key), myPrefs.variant (key));
    213213        break;
    214214
    215       case Prefs :: DOWNLOAD_DIR:
     215      case Prefs::DOWNLOAD_DIR:
    216216        sessionSet (myPrefs.getKey (key), myPrefs.variant (key));
    217217        /* this will change the 'freespace' argument, so refresh */
     
    219219        break;
    220220
    221       case Prefs :: RATIO:
     221      case Prefs::RATIO:
    222222        sessionSet (TR_KEY_seedRatioLimit, myPrefs.variant (key));
    223223        break;
    224       case Prefs :: RATIO_ENABLED:
     224      case Prefs::RATIO_ENABLED:
    225225        sessionSet (TR_KEY_seedRatioLimited, myPrefs.variant (key));
    226226        break;
    227227
    228       case Prefs :: ENCRYPTION:
     228      case Prefs::ENCRYPTION:
    229229        {
    230230          const int i = myPrefs.variant (key).toInt ();
     
    244244        }
    245245
    246       case Prefs :: RPC_AUTH_REQUIRED:
     246      case Prefs::RPC_AUTH_REQUIRED:
    247247        if (mySession)
    248248          tr_sessionSetRPCPasswordEnabled (mySession, myPrefs.getBool (key));
    249249        break;
    250250
    251       case Prefs :: RPC_ENABLED:
     251      case Prefs::RPC_ENABLED:
    252252        if (mySession)
    253253          tr_sessionSetRPCEnabled (mySession, myPrefs.getBool (key));
    254254        break;
    255255
    256       case Prefs :: RPC_PASSWORD:
     256      case Prefs::RPC_PASSWORD:
    257257        if (mySession)
    258258          tr_sessionSetRPCPassword (mySession, myPrefs.getString (key).toUtf8 ().constData ());
    259259        break;
    260260
    261       case Prefs :: RPC_PORT:
     261      case Prefs::RPC_PORT:
    262262        if (mySession)
    263263          tr_sessionSetRPCPort (mySession, myPrefs.getInt (key));
    264264        break;
    265265
    266       case Prefs :: RPC_USERNAME:
     266      case Prefs::RPC_USERNAME:
    267267        if (mySession)
    268268          tr_sessionSetRPCUsername (mySession, myPrefs.getString (key).toUtf8 ().constData ());
    269269        break;
    270270
    271       case Prefs :: RPC_WHITELIST_ENABLED:
     271      case Prefs::RPC_WHITELIST_ENABLED:
    272272        if (mySession)
    273273          tr_sessionSetRPCWhitelistEnabled (mySession, myPrefs.getBool (key));
    274274        break;
    275275
    276       case Prefs :: RPC_WHITELIST:
     276      case Prefs::RPC_WHITELIST:
    277277        if (mySession)
    278278          tr_sessionSetRPCWhitelist (mySession, myPrefs.getString (key).toUtf8 ().constData ());
     
    288288***/
    289289
    290 Session :: Session (const char * configDir, Prefs& prefs):
     290Session::Session (const char * configDir, Prefs& prefs):
    291291  nextUniqueTag (FIRST_UNIQUE_TAG),
    292292  myBlocklistSize (-1),
     
    310310}
    311311
    312 Session :: ~Session ()
     312Session::~Session ()
    313313{
    314314    stop ();
     
    316316
    317317QNetworkAccessManager *
    318 Session :: networkAccessManager ()
     318Session::networkAccessManager ()
    319319{
    320320  if (myNAM == 0)
     
    337337
    338338void
    339 Session :: stop ()
     339Session::stop ()
    340340{
    341341  if (myNAM != 0)
     
    355355
    356356void
    357 Session :: restart ()
     357Session::restart ()
    358358{
    359359  stop ();
     
    362362
    363363void
    364 Session :: start ()
     364Session::start ()
    365365{
    366366  if (myPrefs.get<bool> (Prefs::SESSION_IS_REMOTE))
     
    397397
    398398bool
    399 Session :: isServer () const
     399Session::isServer () const
    400400{
    401401  return mySession != 0;
     
    403403
    404404bool
    405 Session :: isLocal () const
     405Session::isLocal () const
    406406{
    407407  if (mySession != 0)
     
    448448
    449449void
    450 Session :: torrentSet (const QSet<int>& ids, const tr_quark key, double value)
     450Session::torrentSet (const QSet<int>& ids, const tr_quark key, double value)
    451451{
    452452  tr_variant top;
     
    461461
    462462void
    463 Session :: torrentSet (const QSet<int>& ids, const tr_quark key, int value)
     463Session::torrentSet (const QSet<int>& ids, const tr_quark key, int value)
    464464{
    465465  tr_variant top;
     
    474474
    475475void
    476 Session :: torrentSet (const QSet<int>& ids, const tr_quark key, bool value)
     476Session::torrentSet (const QSet<int>& ids, const tr_quark key, bool value)
    477477{
    478478  tr_variant top;
     
    487487
    488488void
    489 Session :: torrentSet (const QSet<int>& ids, const tr_quark key, const QStringList& value)
     489Session::torrentSet (const QSet<int>& ids, const tr_quark key, const QStringList& value)
    490490{
    491491  tr_variant top;
     
    502502
    503503void
    504 Session :: torrentSet (const QSet<int>& ids, const tr_quark key, const QList<int>& value)
     504Session::torrentSet (const QSet<int>& ids, const tr_quark key, const QList<int>& value)
    505505{
    506506  tr_variant top;
     
    517517
    518518void
    519 Session :: torrentSet (const QSet<int>& ids, const tr_quark key, const QPair<int,QString>& value)
     519Session::torrentSet (const QSet<int>& ids, const tr_quark key, const QPair<int,QString>& value)
    520520{
    521521  tr_variant top;
     
    532532
    533533void
    534 Session :: torrentSetLocation (const QSet<int>& ids, const QString& location, bool doMove)
     534Session::torrentSetLocation (const QSet<int>& ids, const QString& location, bool doMove)
    535535{
    536536  tr_variant top;
     
    546546
    547547void
    548 Session :: torrentRenamePath (const QSet<int>& ids, const QString& oldpath, const QString& newname)
     548Session::torrentRenamePath (const QSet<int>& ids, const QString& oldpath, const QString& newname)
    549549{
    550550  tr_variant top;
     
    561561
    562562void
    563 Session :: refreshTorrents (const QSet<int>& ids)
     563Session::refreshTorrents (const QSet<int>& ids)
    564564{
    565565  if (ids.empty ())
     
    582582
    583583void
    584 Session :: refreshExtraStats (const QSet<int>& ids)
     584Session::refreshExtraStats (const QSet<int>& ids)
    585585{
    586586  tr_variant top;
     
    596596
    597597void
    598 Session :: sendTorrentRequest (const char * request, const QSet<int>& ids)
     598Session::sendTorrentRequest (const char * request, const QSet<int>& ids)
    599599{
    600600  tr_variant top;
     
    608608}
    609609
    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 ()
     610void Session::pauseTorrents    (const QSet<int>& ids) { sendTorrentRequest ("torrent-stop",      ids); }
     611void Session::startTorrents    (const QSet<int>& ids) { sendTorrentRequest ("torrent-start",     ids); }
     612void Session::startTorrentsNow (const QSet<int>& ids) { sendTorrentRequest ("torrent-start-now", ids); }
     613void Session::queueMoveTop     (const QSet<int>& ids) { sendTorrentRequest ("queue-move-top",    ids); }
     614void Session::queueMoveUp      (const QSet<int>& ids) { sendTorrentRequest ("queue-move-up",     ids); }
     615void Session::queueMoveDown    (const QSet<int>& ids) { sendTorrentRequest ("queue-move-down",   ids); }
     616void Session::queueMoveBottom  (const QSet<int>& ids) { sendTorrentRequest ("queue-move-bottom", ids); }
     617
     618void
     619Session::refreshActiveTorrents ()
    620620{
    621621  tr_variant top;
     
    631631
    632632void
    633 Session :: refreshAllTorrents ()
     633Session::refreshAllTorrents ()
    634634{
    635635  tr_variant top;
     
    644644
    645645void
    646 Session :: initTorrents (const QSet<int>& ids)
     646Session::initTorrents (const QSet<int>& ids)
    647647{
    648648  tr_variant top;
     
    656656
    657657void
    658 Session :: refreshSessionStats ()
     658Session::refreshSessionStats ()
    659659{
    660660  tr_variant top;
     
    667667
    668668void
    669 Session :: refreshSessionInfo ()
     669Session::refreshSessionInfo ()
    670670{
    671671  tr_variant top;
     
    678678
    679679void
    680 Session :: updateBlocklist ()
     680Session::updateBlocklist ()
    681681{
    682682  tr_variant top;
     
    693693
    694694void
    695 Session :: exec (const tr_variant * request)
     695Session::exec (const tr_variant * request)
    696696{
    697697  char * str = tr_variantToStr (request, TR_VARIANT_FMT_JSON_LEAN, NULL);
     
    701701
    702702void
    703 Session :: localSessionCallback (tr_session * s, struct evbuffer * json, void * vself)
     703Session::localSessionCallback (tr_session * s, struct evbuffer * json, void * vself)
    704704{
    705705  Q_UNUSED (s);
     
    716716
    717717void
    718 Session :: exec (const char * json)
     718Session::exec (const char * json)
    719719{
    720720  if (mySession )
     
    752752
    753753void
    754 Session :: onFinished (QNetworkReply * reply)
     754Session::onFinished (QNetworkReply * reply)
    755755{
    756756#ifdef DEBUG_HTTP
     
    790790
    791791void
    792 Session :: onResponseReceived (const QByteArray& utf8)
     792Session::onResponseReceived (const QByteArray& utf8)
    793793{
    794794  parseResponse (utf8.constData (), utf8.length ());
     
    796796
    797797void
    798 Session :: parseResponse (const char * json, size_t jsonLength)
     798Session::parseResponse (const char * json, size_t jsonLength)
    799799{
    800800    tr_variant top;
     
    921921
    922922void
    923 Session :: updateStats (tr_variant * d, struct tr_session_stats * stats)
     923Session::updateStats (tr_variant * d, struct tr_session_stats * stats)
    924924{
    925925  int64_t i;
     
    940940
    941941void
    942 Session :: updateStats (tr_variant * d)
     942Session::updateStats (tr_variant * d)
    943943{
    944944  tr_variant * c;
     
    954954
    955955void
    956 Session :: updateInfo (tr_variant * d)
     956Session::updateInfo (tr_variant * d)
    957957{
    958958  int64_t i;
     
    968968        continue;
    969969
    970       if (i == Prefs :: ENCRYPTION)
     970      if (i == Prefs::ENCRYPTION)
    971971        {
    972972          const char * val;
     
    985985      switch (myPrefs.type (i))
    986986        {
    987           case QVariant :: Int:
     987          case QVariant::Int:
    988988            {
    989989              int64_t val;
     
    992992              break;
    993993            }
    994           case QVariant :: Double:
     994          case QVariant::Double:
    995995            {
    996996              double val;
     
    999999              break;
    10001000            }
    1001           case QVariant :: Bool:
     1001          case QVariant::Bool:
    10021002            {
    10031003              bool val;
     
    10061006              break;
    10071007            }
    1008           case TrTypes :: FilterModeType:
    1009           case TrTypes :: SortModeType:
    1010           case QVariant :: String:
     1008          case TrTypes::FilterModeType:
     1009          case TrTypes::SortModeType:
     1010          case QVariant::String:
    10111011            {
    10121012              const char * val;
     
    10451045    mySessionVersion = str;
    10461046
    1047   //std::cerr << "Session :: updateInfo end" << std::endl;
     1047  //std::cerr << "Session::updateInfo end" << std::endl;
    10481048  connect (&myPrefs, SIGNAL (changed (int)), this, SLOT (updatePref (int)));
    10491049
     
    10521052
    10531053void
    1054 Session :: setBlocklistSize (int64_t i)
     1054Session::setBlocklistSize (int64_t i)
    10551055{
    10561056  myBlocklistSize = i;
     
    10601060
    10611061void
    1062 Session :: addTorrent (const AddData& addMe, tr_variant& top, bool trashOriginal)
     1062Session::addTorrent (const AddData& addMe, tr_variant& top, bool trashOriginal)
    10631063{
    10641064  assert (tr_variantDictFind (&top, TR_KEY_method) == nullptr);
     
    11141114
    11151115void
    1116 Session :: addTorrent (const AddData& addMe)
     1116Session::addTorrent (const AddData& addMe)
    11171117{
    11181118  tr_variant top;
     
    11251125
    11261126void
    1127 Session :: addNewlyCreatedTorrent (const QString& filename, const QString& localPath)
     1127Session::addNewlyCreatedTorrent (const QString& filename, const QString& localPath)
    11281128{
    11291129  const QByteArray b64 = AddData (filename).toBase64 ();
     
    11421142
    11431143void
    1144 Session :: removeTorrents (const QSet<int>& ids, bool deleteFiles)
     1144Session::removeTorrents (const QSet<int>& ids, bool deleteFiles)
    11451145{
    11461146  if (!ids.isEmpty ())
     
    11581158
    11591159void
    1160 Session :: verifyTorrents (const QSet<int>& ids)
     1160Session::verifyTorrents (const QSet<int>& ids)
    11611161{
    11621162  if (!ids.isEmpty ())
     
    11731173
    11741174void
    1175 Session :: reannounceTorrents (const QSet<int>& ids)
     1175Session::reannounceTorrents (const QSet<int>& ids)
    11761176{
    11771177  if (!ids.isEmpty ())
     
    11921192
    11931193void
    1194 Session :: launchWebInterface ()
     1194Session::launchWebInterface ()
    11951195{
    11961196  QUrl url;
     
    12081208    }
    12091209
    1210   QDesktopServices :: openUrl (url);
    1211 }
     1210  QDesktopServices::openUrl (url);
     1211}
  • trunk/qt/squeezelabel.cc

    r14204 r14377  
    4848
    4949void
    50 SqueezeLabel :: init ()
     50SqueezeLabel::init ()
    5151{
    5252  setTextInteractionFlags(Qt::TextSelectableByMouse);
    5353}
    5454
    55 SqueezeLabel :: SqueezeLabel (const QString& text, QWidget *parent):
     55SqueezeLabel::SqueezeLabel (const QString& text, QWidget * parent):
    5656  QLabel (text, parent)
    5757{
     
    5959}
    6060
    61 SqueezeLabel :: SqueezeLabel (QWidget * parent):
     61SqueezeLabel::SqueezeLabel (QWidget * parent):
    6262  QLabel (parent)
    6363{
     
    6666
    6767void
    68 SqueezeLabel :: paintEvent (QPaintEvent * paintEvent)
     68SqueezeLabel::paintEvent (QPaintEvent * paintEvent)
    6969{
    7070  Q_UNUSED (paintEvent);
  • trunk/qt/stats-dialog.cc

    r14225 r14377  
    2323};
    2424
    25 StatsDialog :: StatsDialog (Session & session, QWidget * parent):
     25StatsDialog::StatsDialog (Session& session, QWidget * parent):
    2626  QDialog (parent, Qt::Dialog),
    2727  mySession (session),
     
    5858}
    5959
    60 StatsDialog :: ~StatsDialog ()
     60StatsDialog::~StatsDialog ()
    6161{
    6262}
    6363
    6464void
    65 StatsDialog :: setVisible (bool visible)
     65StatsDialog::setVisible (bool visible)
    6666{
    6767  myTimer->stop ();
     
    7272
    7373void
    74 StatsDialog :: onTimer ()
     74StatsDialog::onTimer ()
    7575{
    7676  mySession.refreshSessionStats ();
     
    7878
    7979void
    80 StatsDialog :: updateStats ()
     80StatsDialog::updateStats ()
    8181{
    8282  const struct tr_session_stats& current (mySession.getStats ());
  • trunk/qt/torrent-delegate-min.cc

    r14225 r14377  
    4545
    4646QSize
    47 TorrentDelegateMin :: sizeHint (const QStyleOptionViewItem & option,
    48                                 const Torrent              & tor) const
     47TorrentDelegateMin::sizeHint (const QStyleOptionViewItem & option,
     48                              const Torrent              & tor) const
    4949{
    5050  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));
    5252
    5353  QFont nameFont (option.font);
     
    7272
    7373void
    74 TorrentDelegateMin :: drawTorrent (QPainter                   * painter,
    75                                    const QStyleOptionViewItem & option,
    76                                    const Torrent              & tor) const
     74TorrentDelegateMin::drawTorrent (QPainter                   * painter,
     75                                 const QStyleOptionViewItem & option,
     76                                 const Torrent              & tor) const
    7777{
    7878  const bool isPaused (tor.isPaused());
    7979  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));
    8181
    8282  QFont nameFont (option.font);
  • trunk/qt/torrent-delegate.cc

    r14225 r14377  
    3232};
    3333
    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):
     34QColor TorrentDelegate::greenBrush;
     35QColor TorrentDelegate::blueBrush;
     36QColor TorrentDelegate::silverBrush;
     37QColor TorrentDelegate::greenBack;
     38QColor TorrentDelegate::blueBack;
     39QColor TorrentDelegate::silverBack;
     40
     41TorrentDelegate::TorrentDelegate (QObject * parent):
    4242  QStyledItemDelegate (parent),
    4343  myProgressBarStyle (new QStyleOptionProgressBar)
     
    5656}
    5757
    58 TorrentDelegate :: ~TorrentDelegate ()
     58TorrentDelegate::~TorrentDelegate ()
    5959{
    6060  delete myProgressBarStyle;
     
    6666
    6767QSize
    68 TorrentDelegate :: margin (const QStyle& style) const
     68TorrentDelegate::margin (const QStyle& style) const
    6969{
    7070  Q_UNUSED (style);
     
    7474
    7575QString
    76 TorrentDelegate :: progressString (const Torrent& tor) const
     76TorrentDelegate::progressString (const Torrent& tor) const
    7777{
    7878  const bool isMagnet (!tor.hasMetadata());
     
    173173
    174174QString
    175 TorrentDelegate :: shortTransferString (const Torrent& tor) const
     175TorrentDelegate::shortTransferString (const Torrent& tor) const
    176176{
    177177  QString str;
     
    192192
    193193QString
    194 TorrentDelegate :: shortStatusString (const Torrent& tor) const
     194TorrentDelegate::shortStatusString (const Torrent& tor) const
    195195{
    196196  QString str;
     
    220220
    221221QString
    222 TorrentDelegate :: statusString (const Torrent& tor) const
     222TorrentDelegate::statusString (const Torrent& tor) const
    223223{
    224224  QString str;
     
    289289
    290290QSize
    291 TorrentDelegate :: sizeHint (const QStyleOptionViewItem& option, const Torrent& tor) const
     291TorrentDelegate::sizeHint (const QStyleOptionViewItem& option, const Torrent& tor) const
    292292{
    293293  const QStyle* style (QApplication::style ());
     
    315315
    316316QSize
    317 TorrentDelegate :: sizeHint (const QStyleOptionViewItem  & option,
    318                              const QModelIndex           & index) const
     317TorrentDelegate::sizeHint (const QStyleOptionViewItem  & option,
     318                           const QModelIndex           & index) const
    319319{
    320320  const Torrent * tor (index.data (TorrentModel::TorrentRole).value<const Torrent*>());
     
    323323
    324324void
    325 TorrentDelegate :: paint (QPainter                    * painter,
    326                           const QStyleOptionViewItem  & option,
    327                           const QModelIndex           & index) const
     325TorrentDelegate::paint (QPainter                    * painter,
     326                        const QStyleOptionViewItem  & option,
     327                        const QModelIndex           & index) const
    328328{
    329329  const Torrent * tor (index.data (TorrentModel::TorrentRole).value<const Torrent*>());
     
    335335
    336336void
    337 TorrentDelegate :: setProgressBarPercentDone (const QStyleOptionViewItem & option,
    338                                               const Torrent              & tor) const
     337TorrentDelegate::setProgressBarPercentDone (const QStyleOptionViewItem & option,
     338                                            const Torrent              & tor) const
    339339{
    340340  double seedRatioLimit;
     
    354354
    355355void
    356 TorrentDelegate :: drawTorrent (QPainter                   * painter,
    357                                 const QStyleOptionViewItem & option,
    358                                 const Torrent              & tor) const
     356TorrentDelegate::drawTorrent (QPainter                   * painter,
     357                              const QStyleOptionViewItem & option,
     358                              const Torrent              & tor) const
    359359{
    360360  const QStyle * style (QApplication::style ());
  • trunk/qt/torrent-filter.cc

    r14225 r14377  
    1919#include "utils.h"
    2020
    21 TorrentFilter :: TorrentFilter (Prefs& prefs):
     21TorrentFilter::TorrentFilter (Prefs& prefs):
    2222  myPrefs (prefs)
    2323{
     
    2929  // initialize our state from the current prefs
    3030  QList<int> initKeys;
    31   initKeys << Prefs :: SORT_MODE
    32            << Prefs :: FILTER_MODE
    33            << Prefs :: FILTER_TRACKERS
    34            << Prefs :: FILTER_TEXT;
     31  initKeys << Prefs::SORT_MODE
     32           << Prefs::FILTER_MODE
     33           << Prefs::FILTER_TRACKERS
     34           << Prefs::FILTER_TEXT;
    3535  foreach (int key, initKeys)
    3636    refreshPref (key);
    3737}
    3838
    39 TorrentFilter :: ~TorrentFilter ()
     39TorrentFilter::~TorrentFilter ()
    4040{
    4141}
    4242
    4343void
    44 TorrentFilter :: refreshPref (int key)
     44TorrentFilter::refreshPref (int key)
    4545{
    4646  switch (key)
    4747    {
    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:
    5151        invalidateFilter ();
    5252        /* force a re-sort */
    5353        sort (0, !myPrefs.getBool(Prefs::SORT_REVERSED) ? Qt::AscendingOrder : Qt::DescendingOrder);
    5454
    55       case Prefs :: SORT_MODE:
    56       case Prefs :: SORT_REVERSED:
     55      case Prefs::SORT_MODE:
     56      case Prefs::SORT_REVERSED:
    5757        sort (0, myPrefs.getBool(Prefs::SORT_REVERSED) ? Qt::AscendingOrder : Qt::DescendingOrder);
    5858        invalidate ();
     
    8080
    8181bool
    82 TorrentFilter :: lessThan (const QModelIndex& left, const QModelIndex& right) const
     82TorrentFilter::lessThan (const QModelIndex& left, const QModelIndex& right) const
    8383{
    8484  int val = 0;
     
    8888  switch (myPrefs.get<SortMode>(Prefs::SORT_MODE).mode())
    8989    {
    90       case SortMode :: SORT_BY_QUEUE:
     90      case SortMode::SORT_BY_QUEUE:
    9191        if (!val)
    9292          val = -compare (a->queuePosition(), b->queuePosition());
    9393        break;
    9494
    95       case SortMode :: SORT_BY_SIZE:
     95      case SortMode::SORT_BY_SIZE:
    9696        if (!val)
    9797          val = compare (a->sizeWhenDone(), b->sizeWhenDone());
    9898        break;
    9999
    100       case SortMode :: SORT_BY_AGE:
     100      case SortMode::SORT_BY_AGE:
    101101        val = compare (a->dateAdded().toTime_t(), b->dateAdded().toTime_t());
    102102        break;
    103103
    104       case SortMode :: SORT_BY_ID:
     104      case SortMode::SORT_BY_ID:
    105105        if (!val)
    106106          val = compare (a->id(), b->id());
    107107        break;
    108108
    109       case SortMode :: SORT_BY_ACTIVITY:
     109      case SortMode::SORT_BY_ACTIVITY:
    110110        if (!val)
    111111          val = compare (a->downloadSpeed() + a->uploadSpeed(), b->downloadSpeed() + b->uploadSpeed());
     
    115115        // fall through
    116116
    117       case SortMode :: SORT_BY_STATE:
     117      case SortMode::SORT_BY_STATE:
    118118        if (!val)
    119119          val = -compare (a->isPaused(), b->isPaused());
     
    126126        // fall through
    127127
    128       case SortMode :: SORT_BY_PROGRESS:
     128      case SortMode::SORT_BY_PROGRESS:
    129129        if (!val)
    130130          val = compare (a->percentComplete(), b->percentComplete());
     
    134134          val = -compare (a->queuePosition(), b->queuePosition());
    135135
    136       case SortMode :: SORT_BY_RATIO:
     136      case SortMode::SORT_BY_RATIO:
    137137        if (!val)
    138138          val = a->compareRatio (*b);
    139139        break;
    140140
    141       case SortMode :: SORT_BY_ETA:
     141      case SortMode::SORT_BY_ETA:
    142142        if (!val)
    143143          val = a->compareETA (*b);
     
    163163
    164164bool
    165 TorrentFilter :: trackerFilterAcceptsTorrent (const Torrent * tor, const QString& tracker) const
     165TorrentFilter::trackerFilterAcceptsTorrent (const Torrent * tor, const QString& tracker) const
    166166{
    167167  return tracker.isEmpty() || tor->hasTrackerSubstring (tracker);
     
    169169
    170170bool
    171 TorrentFilter :: activityFilterAcceptsTorrent (const Torrent * tor, const FilterMode& m) const
     171TorrentFilter::activityFilterAcceptsTorrent (const Torrent * tor, const FilterMode& m) const
    172172{
    173173  bool accepts;
     
    212212
    213213bool
    214 TorrentFilter :: filterAcceptsRow (int sourceRow, const QModelIndex& sourceParent) const
     214TorrentFilter::filterAcceptsRow (int sourceRow, const QModelIndex& sourceParent) const
    215215{
    216216  QModelIndex childIndex = sourceModel()->index (sourceRow, 0, sourceParent);
     
    241241
    242242int
    243 TorrentFilter :: hiddenRowCount () const
     243TorrentFilter::hiddenRowCount () const
    244244{
    245245  return sourceModel()->rowCount () - rowCount ();
     
    247247
    248248void
    249 TorrentFilter :: countTorrentsPerMode (int * setmeCounts) const
     249TorrentFilter::countTorrentsPerMode (int * setmeCounts) const
    250250{
    251251  std::fill_n (setmeCounts, static_cast<std::size_t>(FilterMode::NUM_MODES), 0);
  • trunk/qt/torrent-model.cc

    r14225 r14377  
    1818
    1919void
    20 TorrentModel :: clear ()
     20TorrentModel::clear ()
    2121{
    2222  beginResetModel ();
     
    3131
    3232int
    33 TorrentModel :: rowCount (const QModelIndex& parent) const
     33TorrentModel::rowCount (const QModelIndex& parent) const
    3434{
    3535  Q_UNUSED (parent);
     
    3939
    4040QVariant
    41 TorrentModel :: data (const QModelIndex& index, int role) const
     41TorrentModel::data (const QModelIndex& index, int role) const
    4242{
    4343  QVariant var;
     
    7474
    7575void
    76 TorrentModel :: addTorrent (Torrent * t)
     76TorrentModel::addTorrent (Torrent * t)
    7777{
    7878  myIdToTorrent.insert (t->id (), t);
     
    8181}
    8282
    83 TorrentModel :: TorrentModel (Prefs& prefs):
     83TorrentModel::TorrentModel (Prefs& prefs):
    8484  myPrefs (prefs)
    8585{
    8686}
    8787
    88 TorrentModel :: ~TorrentModel ()
     88TorrentModel::~TorrentModel ()
    8989{
    9090  clear ();
     
    9696
    9797Torrent*
    98 TorrentModel :: getTorrentFromId (int id)
     98TorrentModel::getTorrentFromId (int id)
    9999{
    100100  id_to_torrent_t::iterator it (myIdToTorrent.find (id));
     
    103103
    104104const Torrent*
    105 TorrentModel :: getTorrentFromId (int id) const
     105TorrentModel::getTorrentFromId (int id) const
    106106{
    107107  id_to_torrent_t::const_iterator it (myIdToTorrent.find (id));
     
    114114
    115115void
    116 TorrentModel :: onTorrentChanged (int torrentId)
     116TorrentModel::onTorrentChanged (int torrentId)
    117117{
    118118  const int row (myIdToRow.value (torrentId, -1));
     
    125125
    126126void
    127 TorrentModel :: removeTorrents (tr_variant * torrents)
     127TorrentModel::removeTorrents (tr_variant * torrents)
    128128{
    129129  int i = 0;
     
    138138
    139139void
    140 TorrentModel :: updateTorrents (tr_variant * torrents, bool isCompleteList)
     140TorrentModel::updateTorrents (tr_variant * torrents, bool isCompleteList)
    141141{
    142142  QList<Torrent*> newTorrents;
     
    214214
    215215void
    216 TorrentModel :: removeTorrent (int id)
     216TorrentModel::removeTorrent (int id)
    217217{
    218218  const int row = myIdToRow.value (id, -1);
     
    236236
    237237void
    238 TorrentModel :: getTransferSpeed (Speed   & uploadSpeed,
    239                                   size_t  & uploadPeerCount,
    240                                   Speed   & downloadSpeed,
    241                                   size_t  & downloadPeerCount)
     238TorrentModel::getTransferSpeed (Speed   & uploadSpeed,
     239                                size_t  & uploadPeerCount,
     240                                Speed   & downloadSpeed,
     241                                size_t  & downloadPeerCount)
    242242{
    243243  Speed upSpeed, downSpeed;
     
    260260
    261261QSet<int>
    262 TorrentModel :: getIds () const
     262TorrentModel::getIds () const
    263263{
    264264  QSet<int> ids;
     
    272272
    273273bool
    274 TorrentModel :: hasTorrent (const QString& hashString) const
     274TorrentModel::hasTorrent (const QString& hashString) const
    275275{
    276276  foreach (const Torrent * tor, myTorrents)
  • trunk/qt/torrent.cc

    r14225 r14377  
    3030
    3131
    32 Torrent :: Torrent (Prefs& prefs, int id):
     32Torrent::Torrent (Prefs& prefs, int id):
    3333  magnetTorrent (false),
    3434  myPrefs (prefs)
     
    4343}
    4444
    45 Torrent :: ~Torrent ()
     45Torrent::~Torrent ()
    4646{
    4747}
     
    5151***/
    5252
    53 Torrent :: Property
    54 Torrent :: myProperties[] =
     53Torrent::Property
     54Torrent::myProperties[] =
    5555{
    5656  { ID, TR_KEY_id, QVariant::Int, INFO, },
     
    112112};
    113113
    114 Torrent :: KeyList
    115 Torrent :: buildKeyList (Group group)
     114Torrent::KeyList
     115Torrent::buildKeyList (Group group)
    116116{
    117117  KeyList keys;
     
    125125}
    126126
    127 const Torrent :: KeyList&
    128 Torrent :: getInfoKeys ()
     127const Torrent::KeyList&
     128Torrent::getInfoKeys ()
    129129{
    130130  static KeyList keys;
     
    136136}
    137137
    138 const Torrent :: KeyList&
    139 Torrent :: getStatKeys ()
     138const Torrent::KeyList&
     139Torrent::getStatKeys ()
    140140{
    141141  static KeyList keys (buildKeyList(STAT));
     
    143143}
    144144
    145 const Torrent :: KeyList&
    146 Torrent :: getExtraStatKeys()
     145const Torrent::KeyList&
     146Torrent::getExtraStatKeys()
    147147{
    148148  static KeyList keys;
     
    155155
    156156bool
    157 Torrent :: setInt (int i, int value)
     157Torrent::setInt (int i, int value)
    158158{
    159159  bool changed = false;
     
    172172
    173173bool
    174 Torrent :: setBool (int i, bool value)
     174Torrent::setBool (int i, bool value)
    175175{
    176176  bool changed = false;
     
    189189
    190190bool
    191 Torrent :: setDouble (int i, double value)
     191Torrent::setDouble (int i, double value)
    192192{
    193193  bool changed = false;
     
    206206
    207207bool
    208 Torrent :: setDateTime (int i, const QDateTime& value)
     208Torrent::setDateTime (int i, const QDateTime& value)
    209209{
    210210  bool changed = false;
     
    223223
    224224bool
    225 Torrent :: setSize (int i, qulonglong value)
     225Torrent::setSize (int i, qulonglong value)
    226226{
    227227  bool changed = false;
     
    240240
    241241bool
    242 Torrent :: setString (int i, const char * value)
     242Torrent::setString (int i, const char * value)
    243243{
    244244  bool changed = false;
     
    257257
    258258bool
    259 Torrent :: setIcon (int i, const QIcon& value)
     259Torrent::setIcon (int i, const QIcon& value)
    260260{
    261261  assert (0<=i && i<PROPERTY_COUNT);
     
    267267
    268268int
    269 Torrent :: getInt (int i) const
     269Torrent::getInt (int i) const
    270270{
    271271  assert (0<=i && i<PROPERTY_COUNT);
     
    276276
    277277QDateTime
    278 Torrent :: getDateTime (int i) const
     278Torrent::getDateTime (int i) const
    279279{
    280280  assert (0<=i && i<PROPERTY_COUNT);
     
    285285
    286286bool
    287 Torrent :: getBool (int i) const
     287Torrent::getBool (int i) const
    288288{
    289289  assert (0<=i && i<PROPERTY_COUNT);
     
    294294
    295295qulonglong
    296 Torrent :: getSize (int i) const
     296Torrent::getSize (int i) const
    297297{
    298298    assert (0<=i && i<PROPERTY_COUNT);
     
    302302}
    303303double
    304 Torrent :: getDouble (int i) const
     304Torrent::getDouble (int i) const
    305305{
    306306  assert (0<=i && i<PROPERTY_COUNT);
     
    310310}
    311311QString
    312 Torrent :: getString (int i) const
     312Torrent::getString (int i) const
    313313{
    314314  assert (0<=i && i<PROPERTY_COUNT);
     
    318318}
    319319QIcon
    320 Torrent :: getIcon (int i) const
     320Torrent::getIcon (int i) const
    321321{
    322322  assert (0<=i && i<PROPERTY_COUNT);
     
    331331
    332332bool
    333 Torrent :: getSeedRatio (double& ratio) const
     333Torrent::getSeedRatio (double& ratio) const
    334334{
    335335  bool isLimited;
     
    343343
    344344      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);
    347347        break;
    348348
     
    356356
    357357bool
    358 Torrent :: hasFileSubstring (const QString& substr) const
     358Torrent::hasFileSubstring (const QString& substr) const
    359359{
    360360  foreach (const TrFile file, myFiles)
     
    366366
    367367bool
    368 Torrent :: hasTrackerSubstring (const QString& substr) const
     368Torrent::hasTrackerSubstring (const QString& substr) const
    369369{
    370370  foreach (QString s, myValues[TRACKERS].toStringList())
     
    376376
    377377int
    378 Torrent :: compareSeedRatio (const Torrent& that) const
     378Torrent::compareSeedRatio (const Torrent& that) const
    379379{
    380380  double a;
     
    390390
    391391int
    392 Torrent :: compareRatio (const Torrent& that) const
     392Torrent::compareRatio (const Torrent& that) const
    393393{
    394394  const double a = ratio ();
     
    403403
    404404int
    405 Torrent :: compareETA (const Torrent& that) const
     405Torrent::compareETA (const Torrent& that) const
    406406{
    407407  const bool haveA (hasETA ());
     
    414414
    415415int
    416 Torrent :: compareTracker (const Torrent& that) const
     416Torrent::compareTracker (const Torrent& that) const
    417417{
    418418  Q_UNUSED (that);
     
    427427
    428428void
    429 Torrent :: updateMimeIcon ()
     429Torrent::updateMimeIcon ()
    430430{
    431431  const FileList& files (myFiles);
     
    436436    icon = QFileIconProvider().icon (QFileIconProvider::Folder);
    437437  else if (files.size () == 1)
    438     icon = Utils :: guessMimeIcon (files.at(0).filename);
     438    icon = Utils::guessMimeIcon (files.at(0).filename);
    439439  else
    440440    icon = QIcon ();
     
    448448
    449449void
    450 Torrent :: notifyComplete () const
     450Torrent::notifyComplete () const
    451451{
    452452    // if someone wants to implement notification, here's the hook.
     
    458458
    459459void
    460 Torrent :: update (tr_variant * d)
     460Torrent::update (tr_variant * d)
    461461{
    462462  static bool lookup_initialized = false;
     
    488488      switch (myProperties[property_index].type)
    489489        {
    490           case QVariant :: Int:
     490          case QVariant::Int:
    491491            {
    492492              int64_t val;
     
    495495              break;
    496496            }
    497           case QVariant :: Bool:
     497          case QVariant::Bool:
    498498            {
    499499              bool val;
     
    502502              break;
    503503            }
    504           case QVariant :: String:
     504          case QVariant::String:
    505505            {
    506506              const char * val;
     
    509509              break;
    510510            }
    511           case QVariant :: ULongLong:
     511          case QVariant::ULongLong:
    512512            {
    513513              int64_t val;
     
    516516              break;
    517517            }
    518           case QVariant :: Double:
     518          case QVariant::Double:
    519519            {
    520520              double val;
     
    523523              break;
    524524            }
    525           case QVariant :: DateTime:
     525          case QVariant::DateTime:
    526526            {
    527527              int64_t val;
    528528              if (tr_variantGetInt (child, &val) && val)
    529                 changed |= setDateTime (property_index, QDateTime :: fromTime_t(val));
     529                changed |= setDateTime (property_index, QDateTime::fromTime_t(val));
    530530              break;
    531531            }
    532532
    533           case QVariant :: StringList:
    534           case TrTypes :: PeerList:
     533          case QVariant::StringList:
     534          case TrTypes::PeerList:
    535535            // handled below
    536536            break;
     
    765765
    766766QString
    767 Torrent :: activityString () const
     767Torrent::activityString () const
    768768{
    769769  QString str;
     
    784784
    785785QString
    786 Torrent :: getError () const
     786Torrent::getError () const
    787787{
    788788  QString s = getString (ERROR_STRING);
     
    800800
    801801QPixmap
    802 TrackerStat :: getFavicon () const
     802TrackerStat::getFavicon () const
    803803{
    804804  MyApp * myApp = dynamic_cast<MyApp*>(QApplication::instance());
  • trunk/qt/tracker-delegate.cc

    r14225 r14377  
    3434
    3535QSize
    36 TrackerDelegate :: margin (const QStyle& style) const
     36TrackerDelegate::margin (const QStyle& style) const
    3737{
    3838  Q_UNUSED (style);
     
    4646
    4747QSize
    48 TrackerDelegate :: sizeHint (const QStyleOptionViewItem & option,
    49                              const TrackerInfo          & info) const
     48TrackerDelegate::sizeHint (const QStyleOptionViewItem & option,
     49                           const TrackerInfo          & info) const
    5050{
    5151  Q_UNUSED (option);
     
    5353  QPixmap favicon = info.st.getFavicon ();
    5454
    55   const QString text = TrackerDelegate :: getText(info);
     55  const QString text = TrackerDelegate::getText(info);
    5656  QTextDocument textDoc;
    5757  textDoc.setHtml (text);
     
    6363
    6464QSize
    65 TrackerDelegate :: sizeHint (const QStyleOptionViewItem  & option,
    66                              const QModelIndex           & index) const
     65TrackerDelegate::sizeHint (const QStyleOptionViewItem  & option,
     66                           const QModelIndex           & index) const
    6767{
    6868  const TrackerInfo trackerInfo = index.data (TrackerModel::TrackerRole).value<TrackerInfo>();
     
    7171
    7272void
    73 TrackerDelegate :: paint (QPainter                    * painter,
    74                           const QStyleOptionViewItem  & option,
    75                           const QModelIndex           & index) const
     73TrackerDelegate::paint (QPainter                    * painter,
     74                        const QStyleOptionViewItem  & option,
     75                        const QModelIndex           & index) const
    7676{
    7777  const TrackerInfo trackerInfo = index.data (TrackerModel::TrackerRole).value<TrackerInfo>();
     
    8585
    8686void
    87 TrackerDelegate :: drawTracker (QPainter                    * painter,
    88                                 const QStyleOptionViewItem  & option,
    89                                 const TrackerInfo           & inf) const
     87TrackerDelegate::drawTracker (QPainter                    * painter,
     88                              const QStyleOptionViewItem  & option,
     89                              const TrackerInfo           & inf) const
    9090{
    9191  painter->save();
     
    111111
    112112void
    113 TrackerDelegate :: setShowMore (bool b)
     113TrackerDelegate::setShowMore (bool b)
    114114{
    115115  myShowMore = b;
     
    128128
    129129QString
    130 TrackerDelegate :: getText (const TrackerInfo& inf) const
     130TrackerDelegate::getText (const TrackerInfo& inf) const
    131131{
    132132  QString key;
  • trunk/qt/tracker-model-filter.cc

    r14225 r14377  
    1111#include "tracker-model-filter.h"
    1212
    13 TrackerModelFilter :: TrackerModelFilter (QObject * parent):
     13TrackerModelFilter::TrackerModelFilter (QObject * parent):
    1414  QSortFilterProxyModel (parent),
    1515  myShowBackups (false)
     
    1818
    1919void
    20 TrackerModelFilter :: setShowBackupTrackers (bool b)
     20TrackerModelFilter::setShowBackupTrackers (bool b)
    2121{
    2222  myShowBackups = b;
     
    2525
    2626bool
    27 TrackerModelFilter :: filterAcceptsRow (int                 sourceRow,
    28                                         const QModelIndex & sourceParent) const
     27TrackerModelFilter::filterAcceptsRow (int                 sourceRow,
     28                                      const QModelIndex & sourceParent) const
    2929{
    3030  QModelIndex index = sourceModel()->index(sourceRow, 0, sourceParent);
  • trunk/qt/tracker-model.cc

    r14225 r14377  
    1616
    1717int
    18 TrackerModel :: rowCount (const QModelIndex& parent) const
     18TrackerModel::rowCount (const QModelIndex& parent) const
    1919{
    2020  Q_UNUSED (parent);
     
    2424
    2525QVariant
    26 TrackerModel :: data (const QModelIndex& index, int role) const
     26TrackerModel::data (const QModelIndex& index, int role) const
    2727{
    2828  QVariant var;
     
    7878
    7979void
    80 TrackerModel :: refresh (const TorrentModel& torrentModel, const QSet<int>& ids)
     80TrackerModel::refresh (const TorrentModel& torrentModel, const QSet<int>& ids)
    8181{
    8282  // build a list of the TrackerInfos
     
    153153
    154154int
    155 TrackerModel :: find (int torrentId, const QString& url) const
     155TrackerModel::find (int torrentId, const QString& url) const
    156156{
    157157  for (int i=0, n=myRows.size(); i<n; ++i)
  • trunk/qt/triconpushbutton.cc

    r14225 r14377  
    1717#include "triconpushbutton.h"
    1818
    19 TrIconPushButton :: TrIconPushButton (QWidget * parent):
     19TrIconPushButton::TrIconPushButton (QWidget * parent):
    2020  QPushButton (parent)
    2121{
    2222}
    2323
    24 TrIconPushButton :: TrIconPushButton (const QIcon& icon, QWidget * parent):
     24TrIconPushButton::TrIconPushButton (const QIcon& icon, QWidget * parent):
    2525  QPushButton (parent)
    2626{
     
    2929
    3030QSize
    31 TrIconPushButton :: sizeHint () const
     31TrIconPushButton::sizeHint () const
    3232{
    3333  QSize s = iconSize ();
     
    3737
    3838void
    39 TrIconPushButton :: paintEvent (QPaintEvent *)
     39TrIconPushButton::paintEvent (QPaintEvent *)
    4040{
    4141  QStylePainter p (this);
  • trunk/qt/utils.cc

    r14316 r14377  
    4141
    4242QString
    43 Utils :: remoteFileChooser (QWidget * parent, const QString& title, const QString& myPath, bool dir, bool local)
     43Utils::remoteFileChooser (QWidget * parent, const QString& title, const QString& myPath, bool dir, bool local)
    4444{
    4545  QString path;
     
    6161
    6262void
    63 Utils :: toStderr (const QString& str)
     63Utils::toStderr (const QString& str)
    6464{
    6565  std::cerr << qPrintable(str) << std::endl;
     
    108108
    109109QIcon
    110 Utils :: guessMimeIcon (const QString& filename)
     110Utils::guessMimeIcon (const QString& filename)
    111111{
    112112#ifdef _WIN32
     
    134134  if (fileIcons[0].isNull ())
    135135    {
    136       fallback = QApplication::style()->standardIcon (QStyle :: SP_FileIcon);
     136      fallback = QApplication::style()->standardIcon (QStyle::SP_FileIcon);
    137137
    138138      suffixes[DISK] << QString::fromLatin1("iso");
     
    189189
    190190bool
    191 Utils :: isValidUtf8  (const char *s)
     191Utils::isValidUtf8 (const char * s)
    192192{
    193193  int n;  // number of bytes in a UTF-8 sequence
     
    212212
    213213QString
    214 Utils :: removeTrailingDirSeparator (const QString& path)
     214Utils::removeTrailingDirSeparator (const QString& path)
    215215{
    216216  return path.endsWith (QDir::separator ())
  • trunk/qt/watchdir.cc

    r14375 r14377  
    2424***/
    2525
    26 WatchDir :: WatchDir (const TorrentModel& model):
     26WatchDir::WatchDir (const TorrentModel& model):
    2727  myModel (model),
    2828  myWatcher (0)
     
    3030}
    3131
    32 WatchDir :: ~WatchDir ()
     32WatchDir::~WatchDir ()
    3333{
    3434}
     
    3939
    4040int
    41 WatchDir :: metainfoTest (const QString& filename) const
     41WatchDir::metainfoTest (const QString& filename) const
    4242{
    4343  int ret;
     
    6363
    6464void
    65 WatchDir :: onTimeout ()
     65WatchDir::onTimeout ()
    6666{
    6767  QTimer * t = qobject_cast<QTimer*>(sender());
     
    7575
    7676void
    77 WatchDir :: setPath (const QString& path, bool isEnabled)
     77WatchDir::setPath (const QString& path, bool isEnabled)
    7878{
    7979  // clear out any remnants of the previous watcher, if any
     
    9898
    9999void
    100 WatchDir :: watcherActivated (const QString& path)
     100WatchDir::watcherActivated (const QString& path)
    101101{
    102102  const QDir dir(path);
     
    143143
    144144void
    145 WatchDir :: rescanAllWatchedDirectories ()
     145WatchDir::rescanAllWatchedDirectories ()
    146146{
    147147  if (myWatcher == nullptr)
Note: See TracChangeset for help on using the changeset viewer.