***************************************************************************/
#include <QDateTime>
+#include <QIcon>
#include "aboutdlg.h"
-#include "icon.h"
-#include "iconloader.h"
#include "quassel.h"
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")));
}
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
+#include <QIcon>
#include <QLayout>
#include <QKeyEvent>
#include <QMenu>
#include "chatviewsearchcontroller.h"
#include "chatviewsettings.h"
#include "client.h"
-#include "iconloader.h"
#include "multilineedit.h"
#include "qtui.h"
#include "settings.h"
#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),
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()));
#include <QDesktopServices>
#include <QFontMetrics>
#include <QGraphicsSceneMouseEvent>
+#include <QIcon>
#include <QPainter>
#include <QPalette>
#include <QTextLayout>
#include "chatlinemodel.h"
#include "chatview.h"
#include "contextmenuactionprovider.h"
-#include "iconloader.h"
#include "mainwin.h"
#include "qtui.h"
#include "qtuistyle.h"
#include "chatmonitorview.h"
#include <QAction>
+#include <QIcon>
#include <QMenu>
#include <QContextMenuEvent>
#include "chatitem.h"
#include "chatscene.h"
#include "client.h"
-#include "iconloader.h"
#include "networkmodel.h"
#include "buffermodel.h"
#include "messagemodel.h"
#include <QDesktopServices>
#include <QDrag>
#include <QGraphicsSceneMouseEvent>
+#include <QIcon>
#include <QMenu>
#include <QMenuBar>
#include <QMimeData>
#include "clientbacklogmanager.h"
#include "columnhandleitem.h"
#include "contextmenuactionprovider.h"
-#include "iconloader.h"
#include "mainwin.h"
#include "markerlineitem.h"
#include "messagefilter.h"
#include "chatviewsearchbar.h"
+#include <QIcon>
+
#include "action.h"
#include "actioncollection.h"
-#include "iconloader.h"
#include "qtui.h"
ChatViewSearchBar::ChatViewSearchBar(QWidget *parent)
#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),
***************************************************************************/
#include <QDialogButtonBox>
+#include <QIcon>
#include <QVBoxLayout>
#include "coreconnectdlg.h"
-#include "iconloader.h"
#include "clientsettings.h"
#include "coreaccountsettingspage.h"
#include "coreconnectionstatuswidget.h"
+#include <QIcon>
+
#include "client.h"
-#include "iconloader.h"
#include "signalproxy.h"
CoreConnectionStatusWidget::CoreConnectionStatusWidget(CoreConnection *connection, QWidget *parent)
#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"
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);
}
#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"
#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"
}
-Icon LegacySystemTray::stateIcon() const
+QIcon LegacySystemTray::stateIcon() const
{
if (mode() == Legacy && state() == NeedsAttention && !_blinkState)
return SystemTray::stateIcon(Active);
# include <QSystemTrayIcon>
#endif
+#include <QIcon>
#include <QTimer>
#include "systemtray.h"
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);
#include "mainwin.h"
+#include <QIcon>
#include <QMenuBar>
#include <QMessageBox>
#include <QStatusBar>
#include "debuglogwidget.h"
#include "debugmessagemodelfilter.h"
#include "flatproxymodel.h"
-#include "iconloader.h"
#include "inputwidget.h"
#include "irclistmodel.h"
#include "ircconnectionwizard.h"
***************************************************************************/
#include <QFileDialog>
+#include <QIcon>
#include <QUrl>
#include <phonon/mediaobject.h>
#include "phononnotificationbackend.h"
#include "clientsettings.h"
-#include "iconloader.h"
#include "mainwin.h"
#include "qtui.h"
* 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),
* 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)
{
#include "aliasessettingspage.h"
#include <QHeaderView>
+#include <QIcon>
#include <QItemSelectionModel>
-#include "iconloader.h"
-
AliasesSettingsPage::AliasesSettingsPage(QWidget *parent)
: SettingsPage(tr("IRC"), tr("Aliases"), parent)
{
#include "bufferviewsettingspage.h"
+#include <QIcon>
#include <QMessageBox>
#include "client.h"
-#include "iconloader.h"
#include "network.h"
#include "bufferviewconfig.h"
#include "bufferviewfilter.h"
#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>
#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),
#include "identitiessettingspage.h"
+#include <QIcon>
#include <QInputDialog>
#include <QMessageBox>
#include "client.h"
-#include "iconloader.h"
#include "signalproxy.h"
IdentitiesSettingsPage::IdentitiesSettingsPage(QWidget *parent)
#include <QDragEnterEvent>
#include <QDropEvent>
#include <QFileDialog>
+#include <QIcon>
#include <QMimeData>
#include <QUrl>
#include <QMessageBox>
#endif
#include "client.h"
-#include "iconloader.h"
IdentityEditWidget::IdentityEditWidget(QWidget *parent)
: QWidget(parent)
#include "ignorelistsettingspage.h"
#include <QHeaderView>
+#include <QIcon>
#include <QItemSelectionModel>
#include <QModelIndex>
#include <QPainter>
#include <QString>
#include <QEvent>
#include <QDebug>
-#include "iconloader.h"
IgnoreListSettingsPage::IgnoreListSettingsPage(QWidget *parent)
: SettingsPage(tr("IRC"), tr("Ignore List"), parent)
#include <QDebug>
#include <QKeyEvent>
#include <QHBoxLayout>
+#include <QIcon>
#include <QMessageBox>
#include <QToolButton>
#include "action.h"
#include "actioncollection.h"
-#include "iconloader.h"
#include "keysequencewidget.h"
KeySequenceButton::KeySequenceButton(KeySequenceWidget *d_, QWidget *parent)
***************************************************************************/
#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"
#include "simplenetworkeditor.h"
-#include "iconloader.h"
+#include <QIcon>
#include "networkssettingspage.h"
#include <QtGlobal>
#include "client.h"
-#include "iconloader.h"
#include "networkmodel.h"
#include "systraynotificationbackend.h"
#include "qtui.h"
//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");
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
#include "action.h"
#include "actioncollection.h"
#include "client.h"
-#include "iconloader.h"
#include "qtui.h"
#ifdef HAVE_KDE
_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)
{
}
-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:
case NeedsAttention:
return _needsAttentionIcon;
}
- return Icon();
+ return QIcon();
}
#ifndef SYSTEMTRAY_H_
#define SYSTEMTRAY_H_
-#include "icon.h"
+#include <QIcon>
class Action;
class QMenu;
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);
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;
bool _shouldBeVisible;
QString _toolTipTitle, _toolTipSubTitle;
- Icon _passiveIcon, _activeIcon, _needsAttentionIcon;
+ QIcon _passiveIcon, _activeIcon, _needsAttentionIcon;
bool _animationEnabled;
QMenu *_trayMenu;
#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"
#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"
#include "topicwidget.h"
+#include <QIcon>
+
#include "client.h"
-#include "iconloader.h"
#include "networkmodel.h"
#include "uisettings.h"
#include "graphicalui.h"
flatproxymodel.cpp
fontselector.cpp
graphicalui.cpp
- icon.cpp
- iconloader.cpp
multilineedit.cpp
networkmodelcontroller.cpp
nickview.cpp
#include "client.h"
#include "clientbufferviewconfig.h"
#include "graphicalui.h"
-#include "iconloader.h"
#include "networkmodel.h"
#include "uistyle.h"
#include "clearablelineedit.h"
+#include <QIcon>
#include <QToolButton>
#include <QStyle>
-#include "iconloader.h"
-
ClearableLineEdit::ClearableLineEdit(QWidget *parent)
: QLineEdit(parent)
{
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
+#include <QIcon>
#include <QInputDialog>
#include <QMenu>
#include <QMessageBox>
#include "buffermodel.h"
#include "buffersettings.h"
-#include "iconloader.h"
#include "clientidentity.h"
#include "network.h"
#include "util.h"
+++ /dev/null
-/***************************************************************************
- * 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 ©) : QIcon(copy)
-{
-}
-
-
-Icon &Icon::operator=(const Icon &other)
-{
- if (this != &other) {
- QIcon::operator=(other);
- }
- return *this;
-}
-
-
-#endif
+++ /dev/null
-/***************************************************************************
- * 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 ©);
-
- 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 ©) : KIcon(copy) {};
-};
-
-
-#endif /* HAVE_KDE */
-
-#endif
+++ /dev/null
-/***************************************************************************
- * 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
+++ /dev/null
-/***************************************************************************
- * 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
#include <QComboBox>
#include <QDialogButtonBox>
#include <QGridLayout>
+#include <QIcon>
#include <QLabel>
#include <QLineEdit>
#include <QInputDialog>
#include "buffermodel.h"
#include "buffersettings.h"
-#include "iconloader.h"
#include "clientidentity.h"
#include "network.h"
#include "util.h"
#include "buffersettings.h"
#include "graphicalui.h"
-#include "iconloader.h"
#include "networkmodel.h"
#include "uistyle.h"
* 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)
{
***************************************************************************/
#include <QApplication>
+#include <QIcon>
#include "buffersettings.h"
-#include "iconloader.h"
#include "qssparser.h"
#include "quassel.h"
#include "uistyle.h"