Remove the obsolete Icon and IconLoader classes
authorManuel Nickschas <sputnick@quassel-irc.org>
Sat, 25 Oct 2014 21:14:51 +0000 (23:14 +0200)
committerManuel Nickschas <sputnick@quassel-irc.org>
Sat, 25 Oct 2014 21:16:33 +0000 (23:16 +0200)
Removing (hopefully) all traces of the now obsolete icon
loading support.

48 files changed:
src/qtui/aboutdlg.cpp
src/qtui/bufferwidget.cpp
src/qtui/channellistdlg.cpp
src/qtui/chatitem.cpp
src/qtui/chatmonitorview.cpp
src/qtui/chatscene.cpp
src/qtui/chatviewsearchbar.cpp
src/qtui/coreconfigwizard.cpp
src/qtui/coreconnectdlg.cpp
src/qtui/coreconnectionstatuswidget.cpp
src/qtui/indicatornotificationbackend.cpp
src/qtui/inputwidget.cpp
src/qtui/knotificationbackend.cpp
src/qtui/legacysystemtray.cpp
src/qtui/legacysystemtray.h
src/qtui/mainwin.cpp
src/qtui/phononnotificationbackend.cpp
src/qtui/settingsdlg.cpp
src/qtui/settingspagedlg.cpp
src/qtui/settingspages/aliasessettingspage.cpp
src/qtui/settingspages/bufferviewsettingspage.cpp
src/qtui/settingspages/chatmonitorsettingspage.cpp
src/qtui/settingspages/coreaccountsettingspage.cpp
src/qtui/settingspages/identitiessettingspage.cpp
src/qtui/settingspages/identityeditwidget.cpp
src/qtui/settingspages/ignorelistsettingspage.cpp
src/qtui/settingspages/keysequencewidget.cpp
src/qtui/settingspages/networkssettingspage.cpp
src/qtui/simplenetworkeditor.cpp
src/qtui/snorenotificationbackend.cpp
src/qtui/statusnotifieritem.cpp
src/qtui/systemtray.cpp
src/qtui/systemtray.h
src/qtui/systraynotificationbackend.cpp
src/qtui/taskbarnotificationbackend.cpp
src/qtui/topicwidget.cpp
src/uisupport/CMakeLists.txt
src/uisupport/bufferviewfilter.cpp
src/uisupport/clearablelineedit.cpp
src/uisupport/contextmenuactionprovider.cpp
src/uisupport/icon.cpp [deleted file]
src/uisupport/icon.h [deleted file]
src/uisupport/iconloader.cpp [deleted file]
src/uisupport/iconloader.h [deleted file]
src/uisupport/networkmodelcontroller.cpp
src/uisupport/nickviewfilter.cpp
src/uisupport/toolbaractionprovider.cpp
src/uisupport/uistyle.cpp

index 8bfdad3..14fedb9 100644 (file)
  ***************************************************************************/
 
 #include <QDateTime>
+#include <QIcon>
 
 #include "aboutdlg.h"
-#include "icon.h"
-#include "iconloader.h"
 #include "quassel.h"
 
 AboutDlg::AboutDlg(QWidget *parent) : QDialog(parent)
@@ -39,7 +38,7 @@ AboutDlg::AboutDlg(QWidget *parent) : QDialog(parent)
     ui.contributorTextBrowser->setHtml(contributors());
     ui.thanksToTextBrowser->setHtml(thanksTo());
 
-    setWindowIcon(Icon("quassel"));
+    setWindowIcon(QIcon::fromTheme("quassel", QIcon(":/icons/quassel.png")));
 }
 
 
index 60a3571..370ecdc 100644 (file)
@@ -18,6 +18,7 @@
  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
  ***************************************************************************/
 
+#include <QIcon>
 #include <QLayout>
 #include <QKeyEvent>
 #include <QMenu>
@@ -32,7 +33,6 @@
 #include "chatviewsearchcontroller.h"
 #include "chatviewsettings.h"
 #include "client.h"
-#include "iconloader.h"
 #include "multilineedit.h"
 #include "qtui.h"
 #include "settings.h"
index d81ba3a..0bb2938 100644 (file)
 
 #include <QHeaderView>
 #include <QHBoxLayout>
+#include <QIcon>
 #include <QSpacerItem>
 
 #include "client.h"
 #include "clientirclisthelper.h"
-#include "icon.h"
-#include "iconloader.h"
 
 ChannelListDlg::ChannelListDlg(QWidget *parent)
     : QDialog(parent),
@@ -55,7 +54,7 @@ ChannelListDlg::ChannelListDlg(QWidget *parent)
 
     ui.searchChannelsButton->setAutoDefault(false);
 
-    setWindowIcon(Icon("format-list-unordered"));
+    setWindowIcon(QIcon::fromTheme("format-list-unordered"));
 
     connect(ui.advancedModeLabel, SIGNAL(clicked()), this, SLOT(toggleMode()));
     connect(ui.searchChannelsButton, SIGNAL(clicked()), this, SLOT(requestSearch()));
index 4e19931..9b2e1a6 100644 (file)
@@ -23,6 +23,7 @@
 #include <QDesktopServices>
 #include <QFontMetrics>
 #include <QGraphicsSceneMouseEvent>
+#include <QIcon>
 #include <QPainter>
 #include <QPalette>
 #include <QTextLayout>
@@ -35,7 +36,6 @@
 #include "chatlinemodel.h"
 #include "chatview.h"
 #include "contextmenuactionprovider.h"
-#include "iconloader.h"
 #include "mainwin.h"
 #include "qtui.h"
 #include "qtuistyle.h"
index 3bea4f8..37197ed 100644 (file)
@@ -21,6 +21,7 @@
 #include "chatmonitorview.h"
 
 #include <QAction>
+#include <QIcon>
 #include <QMenu>
 #include <QContextMenuEvent>
 
@@ -29,7 +30,6 @@
 #include "chatitem.h"
 #include "chatscene.h"
 #include "client.h"
-#include "iconloader.h"
 #include "networkmodel.h"
 #include "buffermodel.h"
 #include "messagemodel.h"
index f1ef288..4f3252d 100644 (file)
@@ -23,6 +23,7 @@
 #include <QDesktopServices>
 #include <QDrag>
 #include <QGraphicsSceneMouseEvent>
+#include <QIcon>
 #include <QMenu>
 #include <QMenuBar>
 #include <QMimeData>
@@ -48,7 +49,6 @@
 #include "clientbacklogmanager.h"
 #include "columnhandleitem.h"
 #include "contextmenuactionprovider.h"
-#include "iconloader.h"
 #include "mainwin.h"
 #include "markerlineitem.h"
 #include "messagefilter.h"
index 7113ab5..56b5c8f 100644 (file)
 
 #include "chatviewsearchbar.h"
 
+#include <QIcon>
+
 #include "action.h"
 #include "actioncollection.h"
-#include "iconloader.h"
 #include "qtui.h"
 
 ChatViewSearchBar::ChatViewSearchBar(QWidget *parent)
index 4d065f0..d5d0053 100644 (file)
 #include <QDebug>
 #include <QAbstractButton>
 #include <QFormLayout>
+#include <QIcon>
 #include <QSpinBox>
 
 #include "coreconfigwizard.h"
 #include "coreconnection.h"
-#include "iconloader.h"
 
 CoreConfigWizard::CoreConfigWizard(CoreConnection *connection, const QList<QVariant> &backends, QWidget *parent)
     : QWizard(parent),
index b57e29e..b89d5d5 100644 (file)
  ***************************************************************************/
 
 #include <QDialogButtonBox>
+#include <QIcon>
 #include <QVBoxLayout>
 
 #include "coreconnectdlg.h"
 
-#include "iconloader.h"
 #include "clientsettings.h"
 #include "coreaccountsettingspage.h"
 
index 954004e..9030a21 100644 (file)
@@ -20,8 +20,9 @@
 
 #include "coreconnectionstatuswidget.h"
 
+#include <QIcon>
+
 #include "client.h"
-#include "iconloader.h"
 #include "signalproxy.h"
 
 CoreConnectionStatusWidget::CoreConnectionStatusWidget(CoreConnection *connection, QWidget *parent)
index 2057083..e3cb0e3 100644 (file)
 
 #include "indicatornotificationbackend.h"
 
+#include <QIcon>
+#include <QImage>
+
 #include <qindicateserver.h>
 #include <qindicateindicator.h>
 
 #include "client.h"
 #include "clientsettings.h"
-#include "iconloader.h"
 #include "mainwin.h"
 #include "networkmodel.h"
 #include "qtui.h"
@@ -108,8 +110,8 @@ void IndicatorNotificationBackend::notify(const Notification &notification)
 
     QModelIndex index = Client::networkModel()->bufferIndex(bufferId);
     QVariant icon = QtUi::style()->bufferViewItemData(index, Qt::DecorationRole);
-    if (icon.canConvert<QPixmap>()) {
-        QImage image = icon.value<QPixmap>().toImage();
+    if (icon.canConvert<QIcon>()) {
+        QImage image = icon.value<QIcon>().pixmap(16).toImage();
         indicator->setIconProperty(image);
     }
 
index 86009a6..09378cc 100644 (file)
 
 #include "inputwidget.h"
 
+#include <QIcon>
+
 #include "action.h"
 #include "actioncollection.h"
 #include "bufferview.h"
 #include "client.h"
-#include "iconloader.h"
 #include "ircuser.h"
 #include "networkmodel.h"
 #include "qtui.h"
index 1dd9553..95332a0 100644 (file)
 
 #include <KNotification>
 #include <KNotifyConfigWidget>
+#include <QIcon>
 #include <QTextDocument>
 #include <QVBoxLayout>
 
 #include "knotificationbackend.h"
 
 #include "client.h"
-#include "icon.h"
-#include "iconloader.h"
 #include "mainwin.h"
 #include "networkmodel.h"
 #include "qtui.h"
index 56139e3..d79d5fd 100644 (file)
@@ -142,7 +142,7 @@ void LegacySystemTray::setState(State state_)
 }
 
 
-Icon LegacySystemTray::stateIcon() const
+QIcon LegacySystemTray::stateIcon() const
 {
     if (mode() == Legacy && state() == NeedsAttention && !_blinkState)
         return SystemTray::stateIcon(Active);
index 635554f..1bbef64 100644 (file)
@@ -29,6 +29,7 @@
 #  include <QSystemTrayIcon>
 #endif
 
+#include <QIcon>
 #include <QTimer>
 
 #include "systemtray.h"
@@ -44,7 +45,7 @@ public:
 
     virtual bool isVisible() const;
     virtual inline bool isSystemTrayAvailable() const;
-    virtual Icon stateIcon() const; // overriden to care about blinkState
+    virtual QIcon stateIcon() const; // overriden to care about blinkState
 
 public slots:
     virtual void setState(State state);
index c7796ca..aadddff 100644 (file)
@@ -20,6 +20,7 @@
 
 #include "mainwin.h"
 
+#include <QIcon>
 #include <QMenuBar>
 #include <QMessageBox>
 #include <QStatusBar>
@@ -74,7 +75,6 @@
 #include "debuglogwidget.h"
 #include "debugmessagemodelfilter.h"
 #include "flatproxymodel.h"
-#include "iconloader.h"
 #include "inputwidget.h"
 #include "irclistmodel.h"
 #include "ircconnectionwizard.h"
index f8c613c..8699764 100644 (file)
@@ -19,6 +19,7 @@
  ***************************************************************************/
 
 #include <QFileDialog>
+#include <QIcon>
 #include <QUrl>
 
 #include <phonon/mediaobject.h>
@@ -27,7 +28,6 @@
 #include "phononnotificationbackend.h"
 
 #include "clientsettings.h"
-#include "iconloader.h"
 #include "mainwin.h"
 #include "qtui.h"
 
index 3907694..439971c 100644 (file)
  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
  ***************************************************************************/
 
+#include <QIcon>
 #include <QMessageBox>
 #include <QPushButton>
 
 #include "settingsdlg.h"
 
 #include "client.h"
-#include "iconloader.h"
 
 SettingsDlg::SettingsDlg(QWidget *parent)
     : QDialog(parent),
index a87a0cf..a2e27bd 100644 (file)
  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
  ***************************************************************************/
 
+#include <QIcon>
 #include <QMessageBox>
 #include <QPushButton>
 
 #include "settingspagedlg.h"
 
-#include "iconloader.h"
-
 SettingsPageDlg::SettingsPageDlg(SettingsPage *page, QWidget *parent)
     : QDialog(parent)
 {
index fe8b26e..a2ff08a 100644 (file)
 #include "aliasessettingspage.h"
 
 #include <QHeaderView>
+#include <QIcon>
 #include <QItemSelectionModel>
 
-#include "iconloader.h"
-
 AliasesSettingsPage::AliasesSettingsPage(QWidget *parent)
     : SettingsPage(tr("IRC"), tr("Aliases"), parent)
 {
index 42759ee..f4e9966 100644 (file)
 
 #include "bufferviewsettingspage.h"
 
+#include <QIcon>
 #include <QMessageBox>
 
 #include "client.h"
-#include "iconloader.h"
 #include "network.h"
 #include "bufferviewconfig.h"
 #include "bufferviewfilter.h"
index f2855ef..24ddd22 100644 (file)
 
 #include "chatmonitorsettingspage.h"
 
+#include <QIcon>
+
 #include "client.h"
 #include "networkmodel.h"
 #include "bufferviewconfig.h"
 #include "buffermodel.h"
 #include "bufferview.h"
 #include "bufferviewfilter.h"
-#include "iconloader.h"
 #include "chatviewsettings.h"
 
 #include <QVariant>
index 9b667e0..a4af64e 100644 (file)
 
 #include "coreaccountsettingspage.h"
 
+#include <QIcon>
+
 #include "client.h"
 #include "clientsettings.h"
 #include "coreaccountmodel.h"
-#include "iconloader.h"
 
 CoreAccountSettingsPage::CoreAccountSettingsPage(QWidget *parent)
     : SettingsPage(tr("Remote Cores"), QString(), parent),
index 254b216..577e6e9 100644 (file)
 
 #include "identitiessettingspage.h"
 
+#include <QIcon>
 #include <QInputDialog>
 #include <QMessageBox>
 
 #include "client.h"
-#include "iconloader.h"
 #include "signalproxy.h"
 
 IdentitiesSettingsPage::IdentitiesSettingsPage(QWidget *parent)
index 13be1c9..0f270c7 100644 (file)
@@ -23,6 +23,7 @@
 #include <QDragEnterEvent>
 #include <QDropEvent>
 #include <QFileDialog>
+#include <QIcon>
 #include <QMimeData>
 #include <QUrl>
 #include <QMessageBox>
@@ -34,7 +35,6 @@
 #endif
 
 #include "client.h"
-#include "iconloader.h"
 
 IdentityEditWidget::IdentityEditWidget(QWidget *parent)
     : QWidget(parent)
index 5330626..badc9ae 100644 (file)
@@ -21,6 +21,7 @@
 #include "ignorelistsettingspage.h"
 
 #include <QHeaderView>
+#include <QIcon>
 #include <QItemSelectionModel>
 #include <QModelIndex>
 #include <QPainter>
@@ -28,7 +29,6 @@
 #include <QString>
 #include <QEvent>
 #include <QDebug>
-#include "iconloader.h"
 
 IgnoreListSettingsPage::IgnoreListSettingsPage(QWidget *parent)
     : SettingsPage(tr("IRC"), tr("Ignore List"), parent)
index 38fa2d9..eb16be4 100644 (file)
@@ -29,6 +29,7 @@
 #include <QDebug>
 #include <QKeyEvent>
 #include <QHBoxLayout>
+#include <QIcon>
 #include <QMessageBox>
 #include <QToolButton>
 
@@ -39,7 +40,6 @@
 
 #include "action.h"
 #include "actioncollection.h"
-#include "iconloader.h"
 #include "keysequencewidget.h"
 
 KeySequenceButton::KeySequenceButton(KeySequenceWidget *d_, QWidget *parent)
index c951a5e..71205cb 100644 (file)
  ***************************************************************************/
 
 #include <QHeaderView>
+#include <QIcon>
 #include <QMessageBox>
 #include <QTextCodec>
 
 #include "networkssettingspage.h"
 
 #include "client.h"
-#include "iconloader.h"
 #include "identity.h"
 #include "network.h"
 #include "presetnetworks.h"
index 901170a..7079913 100644 (file)
@@ -20,7 +20,7 @@
 
 #include "simplenetworkeditor.h"
 
-#include "iconloader.h"
+#include <QIcon>
 
 #include "networkssettingspage.h"
 
index d217b9f..6732c54 100644 (file)
@@ -24,7 +24,6 @@
 #include <QtGlobal>
 
 #include "client.h"
-#include "iconloader.h"
 #include "networkmodel.h"
 #include "systraynotificationbackend.h"
 #include "qtui.h"
@@ -50,7 +49,7 @@ SnoreNotificationBackend::SnoreNotificationBackend (QObject *parent)
     //TODO: try to get an instance of the tray icon to be able to show popups
     m_snore = new Snore::SnoreCore();
     m_snore->loadPlugins(Snore::SnorePlugin::BACKEND);
-    m_icon = Snore::Icon(QIcon::fromTheme("quassel").toImage());
+    m_icon = Snore::Icon(QIcon::fromTheme("quassel", QIcon(":/icons/quassel.png")).pixmap(48).toImage());
     m_application = Snore::Application("Quassel", m_icon);
     m_application.hints().setValue("WINDOWS_APP_ID","QuasselProject.QuasselIRC");
 
index df04252..b29a360 100644 (file)
@@ -51,7 +51,7 @@ public:
 protected:
     virtual QString iconNameForAction(QAction *action) // TODO Qt 4.7: fixme when we have converted our iconloader
     {
-        Icon icon(action->icon());
+        QIcon icon(action->icon());
 #if QT_VERSION >= 0x040701
         // QIcon::name() is in the 4.7 git branch, but it is not in 4.7 TP.
         // If you get a build error here, you need to update your pre-release
index 62c60b8..69006d1 100644 (file)
@@ -26,7 +26,6 @@
 #include "action.h"
 #include "actioncollection.h"
 #include "client.h"
-#include "iconloader.h"
 #include "qtui.h"
 
 #ifdef HAVE_KDE
@@ -40,9 +39,9 @@ SystemTray::SystemTray(QWidget *parent)
     _mode(Invalid),
     _state(Passive),
     _shouldBeVisible(true),
-    _passiveIcon(QIcon::fromTheme("quassel-inactive")),
-    _activeIcon(QIcon::fromTheme("quassel")),
-    _needsAttentionIcon(QIcon::fromTheme("quassel-message")),
+    _passiveIcon(QIcon::fromTheme("quassel-inactive", QIcon(":/icons/quassel-inactive.png"))),
+    _activeIcon(QIcon::fromTheme("quassel", QIcon(":/icons/quassel.png"))),
+    _needsAttentionIcon(QIcon::fromTheme("quassel-message", QIcon(":/icons/quassel-message.png"))),
     _trayMenu(0),
     _associatedWidget(parent)
 {
@@ -122,13 +121,13 @@ void SystemTray::setMode(Mode mode_)
 }
 
 
-Icon SystemTray::stateIcon() const
+QIcon SystemTray::stateIcon() const
 {
     return stateIcon(state());
 }
 
 
-Icon SystemTray::stateIcon(State state) const
+QIcon SystemTray::stateIcon(State state) const
 {
     switch (state) {
     case Passive:
@@ -138,7 +137,7 @@ Icon SystemTray::stateIcon(State state) const
     case NeedsAttention:
         return _needsAttentionIcon;
     }
-    return Icon();
+    return QIcon();
 }
 
 
index 151d349..a359ae1 100644 (file)
@@ -21,7 +21,7 @@
 #ifndef SYSTEMTRAY_H_
 #define SYSTEMTRAY_H_
 
-#include "icon.h"
+#include <QIcon>
 
 class Action;
 class QMenu;
@@ -84,7 +84,7 @@ public slots:
 
 signals:
     void activated(SystemTray::ActivationReason);
-    void iconChanged(const Icon &);
+    void iconChanged(const QIcon &icon);
     void animationEnabledChanged(bool);
     void toolTipChanged(const QString &title, const QString &subtitle);
     void messageClicked(uint notificationId);
@@ -97,8 +97,8 @@ protected:
     virtual void setMode(Mode mode);
     inline bool shouldBeVisible() const;
 
-    virtual Icon stateIcon() const;
-    Icon stateIcon(State state) const;
+    virtual QIcon stateIcon() const;
+    QIcon stateIcon(State state) const;
     inline QString toolTipTitle() const;
     inline QString toolTipSubTitle() const;
     inline QMenu *trayMenu() const;
@@ -116,7 +116,7 @@ private:
     bool _shouldBeVisible;
 
     QString _toolTipTitle, _toolTipSubTitle;
-    Icon _passiveIcon, _activeIcon, _needsAttentionIcon;
+    QIcon _passiveIcon, _activeIcon, _needsAttentionIcon;
     bool _animationEnabled;
 
     QMenu *_trayMenu;
index 0d9b8df..551ae98 100644 (file)
 #include <QApplication>
 #include <QCheckBox>
 #include <QGroupBox>
+#include <QIcon>
 #include <QHBoxLayout>
 
 #include "systraynotificationbackend.h"
 
 #include "client.h"
 #include "clientsettings.h"
-#include "icon.h"
-#include "iconloader.h"
 #include "mainwin.h"
 #include "networkmodel.h"
 #include "qtui.h"
index 62cc60b..da57eb4 100644 (file)
 #include <QApplication>
 #include <QCheckBox>
 #include <QHBoxLayout>
+#include <QIcon>
 #include <QSpinBox>
 
 #include "taskbarnotificationbackend.h"
 
 #include "clientsettings.h"
-#include "iconloader.h"
 #include "mainwin.h"
 #include "qtui.h"
 
index fbf1443..8e11e19 100644 (file)
@@ -20,8 +20,9 @@
 
 #include "topicwidget.h"
 
+#include <QIcon>
+
 #include "client.h"
-#include "iconloader.h"
 #include "networkmodel.h"
 #include "uisettings.h"
 #include "graphicalui.h"
index 8be2e95..0019f51 100644 (file)
@@ -17,8 +17,6 @@ set(SOURCES
     flatproxymodel.cpp
     fontselector.cpp
     graphicalui.cpp
-    icon.cpp
-    iconloader.cpp
     multilineedit.cpp
     networkmodelcontroller.cpp
     nickview.cpp
index 2720fd1..cadebda 100644 (file)
@@ -30,7 +30,6 @@
 #include "client.h"
 #include "clientbufferviewconfig.h"
 #include "graphicalui.h"
-#include "iconloader.h"
 #include "networkmodel.h"
 #include "uistyle.h"
 
index 57d7868..5d63494 100644 (file)
 
 #include "clearablelineedit.h"
 
+#include <QIcon>
 #include <QToolButton>
 #include <QStyle>
 
-#include "iconloader.h"
-
 ClearableLineEdit::ClearableLineEdit(QWidget *parent)
     : QLineEdit(parent)
 {
index e605e3b..3211104 100644 (file)
@@ -18,6 +18,7 @@
  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
  ***************************************************************************/
 
+#include <QIcon>
 #include <QInputDialog>
 #include <QMenu>
 #include <QMessageBox>
@@ -27,7 +28,6 @@
 
 #include "buffermodel.h"
 #include "buffersettings.h"
-#include "iconloader.h"
 #include "clientidentity.h"
 #include "network.h"
 #include "util.h"
diff --git a/src/uisupport/icon.cpp b/src/uisupport/icon.cpp
deleted file mode 100644 (file)
index b4b86ef..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2005-2014 by the Quassel Project                        *
- *   devel@quassel-irc.org                                                 *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) version 3.                                           *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; if not, write to the                         *
- *   Free Software Foundation, Inc.,                                       *
- *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
- ***************************************************************************/
-
-#ifndef HAVE_KDE
-
-#include "icon.h"
-#include "iconloader.h"
-
-Icon::Icon() : QIcon()
-{
-}
-
-
-Icon::Icon(const QString &name) : QIcon()
-{
-    addPixmap(IconLoader::global()->loadIcon(name, IconLoader::Desktop));
-}
-
-
-Icon::Icon(const QIcon &copy) : QIcon(copy)
-{
-}
-
-
-Icon &Icon::operator=(const Icon &other)
-{
-    if (this != &other) {
-        QIcon::operator=(other);
-    }
-    return *this;
-}
-
-
-#endif
diff --git a/src/uisupport/icon.h b/src/uisupport/icon.h
deleted file mode 100644 (file)
index b794cd6..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2005-2014 by the Quassel Project                        *
- *   devel@quassel-irc.org                                                 *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) version 3.                                           *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; if not, write to the                         *
- *   Free Software Foundation, Inc.,                                       *
- *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
- ***************************************************************************/
-
-#ifndef ICON_H_
-#define ICON_H_
-
-#ifndef HAVE_KDE
-
-#include <QIcon>
-
-/// A very thin wrapper around QIcon
-/** This wrapper class allows us to load an icon by its theme name rather than its full file name.
- *  The overloaded ctor uses IconLoader to locate an icon with this basename in the current theme
- *  or in Qt Resources.
- */
-class Icon : public QIcon
-{
-public:
-    Icon();
-    explicit Icon(const QString &iconName);
-    explicit Icon(const QIcon &copy);
-
-    Icon &operator=(const Icon &other);
-};
-
-
-#else /* HAVE_KDE */
-#include <KIcon>
-class Icon : public KIcon
-{
-public:
-    inline Icon() : KIcon() {};
-    inline explicit Icon(const QString &iconName) : KIcon(iconName) {};
-    inline explicit Icon(const QIcon &copy) : KIcon(copy) {};
-};
-
-
-#endif /* HAVE_KDE */
-
-#endif
diff --git a/src/uisupport/iconloader.cpp b/src/uisupport/iconloader.cpp
deleted file mode 100644 (file)
index 940c342..0000000
+++ /dev/null
@@ -1,191 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2005-2014 by the Quassel Project                        *
- *   devel@quassel-irc.org                                                 *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) version 3.                                           *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; if not, write to the                         *
- *   Free Software Foundation, Inc.,                                       *
- *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
- ***************************************************************************/
-
-#ifndef HAVE_KDE
-
-#include <QCoreApplication>
-#include <QDebug>
-#include <QDir>
-#include <QFile>
-
-#include "iconloader.h"
-#include "quassel.h"
-#include "util.h"
-
-IconLoader IconLoader::_iconLoader;
-int IconLoader::_groupSize[] = { 48, 22, 22, 16, 32, 22 };  // default sizes taken from Oxygen
-
-IconLoader *IconLoader::global()
-{
-    // Workaround: the static _iconLoader might be initialized before the resources it needs
-    // This way, first call to global() will init it by setting the theme
-    if (_iconLoader.theme().isEmpty())
-        _iconLoader.setTheme("oxygen");
-    return &_iconLoader;
-}
-
-
-IconLoader::IconLoader(QObject *parent) : QObject(parent)
-{
-    // setTheme("oxygen");
-}
-
-
-IconLoader::~IconLoader()
-{
-}
-
-
-void IconLoader::setTheme(const QString &theme)
-{
-    _theme = theme;
-    // check which dirs could contain themed icons
-    _themedIconDirNames.clear();
-    _plainIconDirNames.clear();
-
-    // First, look for a system theme
-    // This is supposed to only work on Unix, though other platforms might set $XDG_DATA_DIRS if they please.
-    QStringList iconDirNames = QString(qgetenv("XDG_DATA_DIRS")).split(':', QString::SkipEmptyParts);
-    if (!iconDirNames.isEmpty()) {
-        for (int i = 0; i < iconDirNames.count(); i++)
-            iconDirNames[i].append(QString("/icons/"));
-    }
-#ifdef Q_OS_UNIX
-    else {
-        // Provide a fallback
-        iconDirNames << "/usr/share/icons/";
-    }
-    // Add our prefix too
-    QString appDir = QCoreApplication::applicationDirPath();
-    int binpos = appDir.lastIndexOf("/bin");
-    if (binpos >= 0) {
-        appDir.replace(binpos, 4, "/share");
-        appDir.append("/icons/");
-        if (!iconDirNames.contains(appDir))
-            iconDirNames.append(appDir);
-    }
-#endif
-
-    // Now look for an icons/ subdir in our data paths
-    foreach(const QString &dir, Quassel::dataDirPaths())
-    iconDirNames << dir + "icons/";
-
-    // Add our resource path too
-    iconDirNames << ":/icons/";
-
-    // Ready do add theme names
-    foreach(const QString &dir, iconDirNames) {
-        QString path = dir + theme + '/';
-        if (QFile::exists(path))
-            _themedIconDirNames << path;
-    }
-    foreach(const QString &dir, iconDirNames) {
-        QString path = dir + "hicolor/";
-        if (QFile::exists(path))
-            _themedIconDirNames << path;
-    }
-
-    // We ship some plain (non-themed) icons in $data/pics
-    foreach(const QString &dir, Quassel::dataDirPaths()) {
-        QString path = dir + "pics/";
-        if (QFile::exists(path))
-            _plainIconDirNames << path;
-    }
-    // And of course, our resource path
-    if (QFile::exists(":/pics"))
-        _plainIconDirNames << ":/pics";
-}
-
-
-// TODO: optionally implement cache (speed/memory tradeoff?)
-QPixmap IconLoader::loadIcon(const QString &name, IconLoader::Group group, int size)
-{
-    if (group < 0 || group >= LastGroup) {
-        qWarning() << "Invalid icon group!";
-        return QPixmap();
-    }
-    if (size == 0)
-        size = _groupSize[group];
-
-    QString path = findIconPath(name, size);
-    if (path.isEmpty()) return QPixmap();
-
-    // load the icon
-    return QPixmap(path);
-}
-
-
-QString IconLoader::findIconPath(const QString &name, int size)
-{
-    QString fname = QString("%1.png").arg(name); // we only support PNG so far
-    // First, look for a themed icon... we don't do anything fancy here, only exact match for both name and size
-    foreach(QString basedir, _themedIconDirNames) {
-        QDir sizedir(QString("%1/%2x%2").arg(basedir).arg(QString::number(size)));
-        if (sizedir.exists()) {
-            // ignore context, i.e. scan all subdirs
-            QStringList contextdirs = sizedir.entryList(QDir::Dirs | QDir::NoDotAndDotDot);
-            foreach(QString dir, contextdirs) {
-                QString path = QString("%1/%2/%3").arg(sizedir.absolutePath(), dir, fname);
-                if (QFile::exists(path)) return path;
-            }
-        }
-    }
-    // Now check the plain dirs
-    foreach(QString dir, _plainIconDirNames) {
-        QString path = QString("%1/%2").arg(dir, name);
-        if (QFile::exists(path)) return path;
-    }
-
-    qWarning() << "Icon not found:" << name << size;
-    return QString();
-}
-
-
-// Convenience constructors
-
-QPixmap DesktopIcon(const QString &name, int force_size)
-{
-    IconLoader *loader = IconLoader::global();
-    return loader->loadIcon(name, IconLoader::Desktop, force_size);
-}
-
-
-QPixmap BarIcon(const QString &name, int force_size)
-{
-    IconLoader *loader = IconLoader::global();
-    return loader->loadIcon(name, IconLoader::Toolbar, force_size);
-}
-
-
-QPixmap MainBarIcon(const QString &name, int force_size)
-{
-    IconLoader *loader = IconLoader::global();
-    return loader->loadIcon(name, IconLoader::MainToolbar, force_size);
-}
-
-
-QPixmap SmallIcon(const QString &name, int force_size)
-{
-    IconLoader *loader = IconLoader::global();
-    return loader->loadIcon(name, IconLoader::Small, force_size);
-}
-
-
-#endif
diff --git a/src/uisupport/iconloader.h b/src/uisupport/iconloader.h
deleted file mode 100644 (file)
index ee94db6..0000000
+++ /dev/null
@@ -1,120 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2005-2014 by the Quassel Project                        *
- *   devel@quassel-irc.org                                                 *
- *                                                                         *
- *   Based in part on KDE's kiconloader.h                                  *
- *   This declares a subset of that API.                                   *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) version 3.                                           *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; if not, write to the                         *
- *   Free Software Foundation, Inc.,                                       *
- *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
- ***************************************************************************/
-
-#ifndef ICONLOADER_H_
-#define ICONLOADER_H_
-
-#ifndef HAVE_KDE
-
-#include <QPixmap>
-
-/// Provides basic facilities to load icons from standard locations or resources
-/** This implements a (very) basic subset of KIconLoader's API, such that we can use those classes
- *  interchangeably in Quassel.
- *
- *  We currently (unless somebody does a more fancy implementation ;-)) assume the Oxygen icon theme
- *  to be used. In particular, this means that we do assume its directory layout and existing icons to
- *  be present. Though it should be easy to switch to a different theme name, we don't currently support
- *  any fallback mechanism if this other theme misses an icon for a given size. Also, we only support PNG.
- *
- *  Since we do support integrating the required part of Oxygen into the binary via Qt Resources, this
- *  should work for everyone for now.
- *
- *  - $XDG_DATA_DIRS/icons/$theme (in order)
- *  - :/icons/$theme (fallback in case we use Qt Resources)
- *  - $XDG_DATA_DIRS/apps/quassel/icons/hicolor (our own unthemed icons)
- *  - :/icons/hicolor
- *  - $XDG_DATA_DIRS/apps/quassel/pics
- *  - :/pics
- *
- *  We don't search for size/context dirs in /pics, i.e. for a given $name, we expect pics/$name.png.
- */
-class IconLoader : public QObject
-{
-    Q_OBJECT
-
-public:
-    enum Group {
-        NoGroup = -1, ///< No group
-        Desktop = 0, ///< Desktop icons
-        Toolbar,    ///< Toolbar icons
-        MainToolbar, ///< Main toolbar icons
-        Small,      ///< Small icons, e.g. for buttons
-        Panel,      ///< Panel icons
-        Dialog,     ///< Icons for use in dialog title etc.
-        LastGroup
-    };
-
-    /// Standard icon sizes
-    enum StdSizes {
-        SizeSmall = 16,   ///< Small icons for menu entries
-        SizeSmallMedium = 22, ///< Slightly larger small icons for toolbars, panels, etc
-        SizeMedium = 32,  ///< Medium-sized icons for the desktop
-        SizeLarge = 48,   ///< Large icons for the panel
-        SizeHuge = 64,    ///< Huge icons for iconviews
-        SizeEnormous = 128 ///< Enormous icons for iconviews
-    };
-
-    explicit IconLoader(QObject *parent = 0);
-    ~IconLoader();
-
-    static IconLoader *global();
-
-    /// Load a pixmap for the given name and group
-    QPixmap loadIcon(const QString &name, IconLoader::Group group, int size = 0);
-
-    inline QString theme() const;
-    void setTheme(const QString &name);
-
-private:
-    QString findIconPath(const QString &name, int size);
-
-    static IconLoader _iconLoader;
-    QString _theme;
-    QStringList _themedIconDirNames;
-    QStringList _plainIconDirNames;
-    static int _groupSize[];
-};
-
-
-// convenience
-QPixmap DesktopIcon(const QString &name, int size = 0);
-QPixmap BarIcon(const QString &name, int size = 0);
-QPixmap MainBarIcon(const QString &name, int size = 0);
-QPixmap SmallIcon(const QString &name, int size = 0);
-//QPixmap SmallMediumIcon(const QString &name, int size = 0);  // not part of KIconLoader
-
-QString IconLoader::theme() const { return _theme; }
-
-#else /* HAVE_KDE */
-
-#include <KIconLoader>
-class IconLoader : public KIconLoader
-{
-    Q_OBJECT
-};
-
-
-#endif /* HAVE_KDE */
-
-#endif
index 0dcd718..74a5bda 100644 (file)
@@ -21,6 +21,7 @@
 #include <QComboBox>
 #include <QDialogButtonBox>
 #include <QGridLayout>
+#include <QIcon>
 #include <QLabel>
 #include <QLineEdit>
 #include <QInputDialog>
@@ -31,7 +32,6 @@
 
 #include "buffermodel.h"
 #include "buffersettings.h"
-#include "iconloader.h"
 #include "clientidentity.h"
 #include "network.h"
 #include "util.h"
index 83a7ce3..fdb5871 100644 (file)
@@ -22,7 +22,6 @@
 
 #include "buffersettings.h"
 #include "graphicalui.h"
-#include "iconloader.h"
 #include "networkmodel.h"
 #include "uistyle.h"
 
index 15d89b0..00d5cd1 100644 (file)
  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
  ***************************************************************************/
 
+#include <QIcon>
 #include <QMenu>
 #include <QToolBar>
 
 #include "toolbaractionprovider.h"
 
-#include "iconloader.h"
-
 ToolBarActionProvider::ToolBarActionProvider(QObject *parent)
     : NetworkModelController(parent)
 {
index d219f27..838cfca 100644 (file)
@@ -19,9 +19,9 @@
  ***************************************************************************/
 
 #include <QApplication>
+#include <QIcon>
 
 #include "buffersettings.h"
-#include "iconloader.h"
 #include "qssparser.h"
 #include "quassel.h"
 #include "uistyle.h"