1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 10:46:35 +01:00

Define QzTools::setWmClass on all platforms.

Get rid of #ifdef's and make it do nothing on non X11.
This commit is contained in:
nowrep 2013-07-08 00:08:05 +02:00
parent 2dcb5efbb1
commit 7e00f73daf
7 changed files with 8 additions and 13 deletions

View File

@ -153,9 +153,7 @@ QupZilla::QupZilla(Qz::BrowserWindow type, QUrl startUrl)
QTimer::singleShot(0, this, SLOT(postLaunch()));
#if defined(QZ_WS_X11) && !defined(NO_X11)
QzTools::setWmClass("Browser", this);
#endif
}
void QupZilla::openWithTab(WebTab* tab)

View File

@ -77,9 +77,7 @@ CookieManager::CookieManager(QWidget* parent)
QShortcut* removeShortcut = new QShortcut(QKeySequence("Del"), this);
connect(removeShortcut, SIGNAL(activated()), this, SLOT(deletePressed()));
#if defined(QZ_WS_X11) && !defined(NO_X11)
QzTools::setWmClass("Cookies", this);
#endif
}
void CookieManager::removeAll()

View File

@ -59,10 +59,7 @@ BrowsingLibrary::BrowsingLibrary(QupZilla* mainClass, QWidget* parent)
connect(ui->tabs, SIGNAL(CurrentChanged(int)), this, SLOT(currentIndexChanged(int)));
connect(ui->searchLine, SIGNAL(textChanged(QString)), this, SLOT(search()));
#if defined(QZ_WS_X11) && !defined(NO_X11)
QzTools::setWmClass("Browsing Library", this);
#endif
}
void BrowsingLibrary::currentIndexChanged(int index)

View File

@ -481,9 +481,7 @@ Preferences::Preferences(QupZilla* mainClass, QWidget* parent)
ui->html5permissions->setDisabled(true);
#endif
#if defined(QZ_WS_X11) && !defined(NO_X11)
QzTools::setWmClass("Preferences", this);
#endif
}
void Preferences::showStackedPage(QListWidgetItem* item)

View File

@ -657,17 +657,22 @@ Display* QzTools::X11Display(const QWidget* widget)
return QX11Info::display();
#endif
}
#endif
void QzTools::setWmClass(const QString &name, const QWidget* widget)
{
#if defined(QZ_WS_X11) && !defined(NO_X11)
QByteArray nameData = name.toUtf8();
XClassHint classHint;
classHint.res_name = const_cast<char*>(nameData.constData());
classHint.res_class = const_cast<char*>("QupZilla");
XSetClassHint(X11Display(widget), widget->winId(), &classHint);
}
#else
Q_UNUSED(name)
Q_UNUSED(widget)
#endif
}
QString QzTools::operatingSystem()
{

View File

@ -75,9 +75,10 @@ QString QT_QUPZILLA_EXPORT escape(const QString &string);
#if defined(QZ_WS_X11) && !defined(NO_X11)
Display* X11Display(const QWidget* widget);
void QT_QUPZILLA_EXPORT setWmClass(const QString &name, const QWidget* widget);
#endif
void QT_QUPZILLA_EXPORT setWmClass(const QString &name, const QWidget* widget);
template <typename T>
bool listContainsIndex(const QList<T> &list, int index)
{

View File

@ -177,9 +177,7 @@ SiteInfo::SiteInfo(WebView* view, QWidget* parent)
ui->treeTags->sortByColumn(-1);
#if defined(QZ_WS_X11) && !defined(NO_X11)
QzTools::setWmClass("Site Info", this);
#endif
}
void SiteInfo::imagesCustomContextMenuRequested(const QPoint &p)