From cd7e5291db3907365c1d96a60b474ef39eaf511a Mon Sep 17 00:00:00 2001 From: Jordan Lee Date: Fri, 9 May 2014 02:32:28 +0000 Subject: [PATCH] silence warnings found by clang++ --- qt/app.cc | 6 +++--- qt/app.h | 2 +- qt/mainwin.cc | 17 +---------------- qt/qtr.pro | 2 +- 4 files changed, 6 insertions(+), 21 deletions(-) diff --git a/qt/app.cc b/qt/app.cc index a4fd18cd2..8e3bf5e3f 100644 --- a/qt/app.cc +++ b/qt/app.cc @@ -291,7 +291,7 @@ MyApp :: onTorrentCompleted (int id) if (tor) { if (myPrefs->getBool (Prefs::SHOW_NOTIFICATION_ON_COMPLETE)) - notify (tr ("Torrent Completed"), tor->name ()); + notifyApp (tr ("Torrent Completed"), tor->name ()); if (myPrefs->getBool (Prefs::COMPLETE_SOUND_ENABLED)) { @@ -315,7 +315,7 @@ MyApp :: onNewTorrentChanged (int id) { const int age_secs = tor->dateAdded ().secsTo (QDateTime::currentDateTime ()); if (age_secs < 30) - notify (tr ("Torrent Added"), tor->name ()); + notifyApp (tr ("Torrent Added"), tor->name ()); disconnect (tor, SIGNAL (torrentChanged (int)), this, SLOT (onNewTorrentChanged (int))); @@ -459,7 +459,7 @@ MyApp :: raise () } bool -MyApp :: notify (const QString& title, const QString& body) const +MyApp :: notifyApp (const QString& title, const QString& body) const { const QString dbusServiceName = QString::fromUtf8 ("org.freedesktop.Notifications"); const QString dbusInterfaceName = QString::fromUtf8 ("org.freedesktop.Notifications"); diff --git a/qt/app.h b/qt/app.h index 3d4eaa229..8859ad0c7 100644 --- a/qt/app.h +++ b/qt/app.h @@ -34,7 +34,7 @@ class MyApp: public QApplication public: void raise (); - bool notify (const QString& title, const QString& body) const; + bool notifyApp (const QString& title, const QString& body) const; public: Favicons favicons; diff --git a/qt/mainwin.cc b/qt/mainwin.cc index d8cf0e42f..f3c986acb 100644 --- a/qt/mainwin.cc +++ b/qt/mainwin.cc @@ -81,22 +81,6 @@ TrMainWindow :: getStockIcon (const QString& name, int fallback) return icon; } -namespace -{ - QSize calculateTextButtonSizeHint (QPushButton * button) - { - QStyleOptionButton opt; - opt.initFrom (button); - QString s (button->text ()); - if (s.isEmpty ()) - s = QString::fromLatin1 ("XXXX"); - QFontMetrics fm = button->fontMetrics (); - QSize sz = fm.size (Qt::TextShowMnemonic, s); - return button->style ()->sizeFromContents (QStyle::CT_PushButton, &opt, sz, button).expandedTo (QApplication::globalStrut ()); - } -} - - TrMainWindow :: TrMainWindow (Session& session, Prefs& prefs, TorrentModel& model, bool minimized): myLastFullUpdateTime (0), mySessionDialog (new SessionDialog (session, prefs, this)), @@ -1170,6 +1154,7 @@ TrMainWindow :: newTorrent () void TrMainWindow :: openTorrent () { +std::cerr << __FILE__ << ':' << __LINE__ << std::endl; QFileDialog * d; d = new QFileDialog (this, tr ("Open Torrent"), diff --git a/qt/qtr.pro b/qt/qtr.pro index f39005397..a800ddcd7 100644 --- a/qt/qtr.pro +++ b/qt/qtr.pro @@ -11,7 +11,7 @@ unix: INSTALLS += man man.path = /share/man/man1/ man.files = transmission-qt.1 -CONFIG += qt thread debug link_pkgconfig c++11 +CONFIG += qt thread debug link_pkgconfig c++11 warn_on QT += network dbus PKGCONFIG = fontconfig libcurl openssl libevent -- 2.40.0