mirror of
https://invent.kde.org/network/falkon.git
synced 2024-11-11 09:32:12 +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:
parent
2dcb5efbb1
commit
7e00f73daf
|
@ -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)
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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()
|
||||
{
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue
Block a user