Skip to content

Commit

Permalink
WIP Qt6 port (#2024)
Browse files Browse the repository at this point in the history
* CMake: FindXCB components are upper case

Fixes CMake error

* CMake: update dependencies for Qt6

* CMake: link to dbusmenu-lxqt instead of dbusmenu-qt6

StatusNotifierButton: switch to dbusmenu-lxqt

* Replace qAsConst() with std::as_const

* Replace QPair with std::pair

* Replace QLatin1Literal with QLatin1String

* QEvent: port pos() to position() and globalPos() to globalPosition()

- Now returns floating point QPointF, should we keep
it instead of rounding and do floating point calculations?

* Fix QWidget::enterEvent(QEnterEvent*) signature

* QLayou::setContentsMargin() instead of setMargin()

- QEyesPlugin: remove deprecated setMargin() call

* QuickLaunchButton: fix ambiguous list initializer

* Port QRegExp with QRegularExpression

* QLocale territory() instead of country()

* Qt6 always enables High-DPI Pixmaps

Qt::AA_UseHighDpiPixmaps has no effect now

* Plugin: move Q_DECLARE_METATYPE()

Fix error:
static assertion failed: Pointer Meta Types must either point to
fully-defined types or be declared with Q_DECLARE_OPAQUE_POINTER(T *)

Q_DECLARE_METATYPE(...) must be used on fully qualified types
To avoid including plugin.h inside panelpluginsmodel.h,
the declaretion is moved.

* Use QColor::fromString()

setNamedColor() is deprecated in Qt6

* LXQtTaskButton: fix deprecated constructor

* Disable ColorPicker on Wayland

* Fix KX11Extras, KWindowSystem includes

TODO: Still don't know why prefix does not work

- Remove includes to QDesktopWidget

* Port QX11Info to QX11Application

NOTE: Fix compilation with Xlib.h

Xlib.h is tricky because at line 82 has:

`#define Bool int`

And QtCore/qjsonvalue.h at line 28 has:

```
enum Type {
   ...
   Bool = 0x1,
   ...
}
```

This is fixed temporarily by moving Xlib.h
include to last and undefine Bool macro

Long term we want to hide X11 related code and encapsulate in a backend.
This backend will not expose X11 headers.

* LXQtTaskButton: port to KX11Extras

Many X11 specific functions got moved away from KWindowSystem header.

Long term we will move everything to a backend.

* LXQtTaskButton: port away from QDesktopWidget

Use QScreen instead

* QString::arg(...) use mult-arg version

Reported by Clazy

* LXQtCpuLoad: do not include <QtCore> directly

Reported by Clazy

* Configuration: fix call to temporary object

Teporary objects get destroyed after call ends.
State is not updated.

* QEyesConfigDialog: avoid allocating temporary container

- Reported by Clazy
- Also fix formatting a bit

* QEyesImageWidget: unneeded QString allocation

- Use Qt::CaseInsensitive instead
- Pass argument by reference
- Format braces

* LXQtQuickLaunch: fix QSet warning and better readability

* Port LXQtTrayPlugin to Qt6

NOTE: QX11Info::getTimestamp() was replaced with XCB_CURRENT_TIME macro.

I don't know if this breaks functionality.
Getting real timestamp involves messing with Qt private APIs

* LXQtTaskBar: fix include recursion

- Forward declare classes
- More refactory could be done here

* Port LXQtKbIndicatorPlugin to Qt6

* Replace QScopedPointer with std::unique_ptr

- Use Xcb::ScopedCPointer for POD types

* Replace QVector with QList

In Qt6 it's an alias

* SNIProxy: use QBitmap::fromImage TODO

TODO: is behavior equivalent? Conversion flags...

* README: update mentioned dependencies
  • Loading branch information
gfgit authored Mar 25, 2024
1 parent 371f60f commit 64f8a5a
Show file tree
Hide file tree
Showing 92 changed files with 585 additions and 386 deletions.
21 changes: 10 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,16 @@ set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)

set(REQUIRED_QT_VERSION "5.15.0")
set(KF5_MINIMUM_VERSION "5.101.0")
set(LXQT_GLOBALKEYS_MINIMUM_VERSION "1.4.0")
set(LXQT_MINIMUM_VERSION "1.4.0")

find_package(Qt5DBus ${REQUIRED_QT_VERSION} REQUIRED)
find_package(Qt5LinguistTools ${REQUIRED_QT_VERSION} REQUIRED)
find_package(Qt5Widgets ${REQUIRED_QT_VERSION} REQUIRED)
find_package(Qt5X11Extras ${REQUIRED_QT_VERSION} REQUIRED)
find_package(Qt5Xml ${REQUIRED_QT_VERSION} REQUIRED)
find_package(KF5WindowSystem ${KF5_MINIMUM_VERSION} REQUIRED)
set(REQUIRED_QT_VERSION "6.6.0")
set(KF6_MINIMUM_VERSION "6.0.0")
set(LXQT_GLOBALKEYS_MINIMUM_VERSION "2.0.0")
set(LXQT_MINIMUM_VERSION "2.0.0")

find_package(Qt6DBus ${REQUIRED_QT_VERSION} REQUIRED)
find_package(Qt6LinguistTools ${REQUIRED_QT_VERSION} REQUIRED)
find_package(Qt6Widgets ${REQUIRED_QT_VERSION} REQUIRED)
find_package(Qt6Xml ${REQUIRED_QT_VERSION} REQUIRED)
find_package(KF6WindowSystem ${KF6_MINIMUM_VERSION} REQUIRED)
find_package(lxqt ${LXQT_MINIMUM_VERSION} REQUIRED)
find_package(lxqt-globalkeys-ui ${LXQT_GLOBALKEYS_MINIMUM_VERSION} REQUIRED)
find_package(lxqt-menu-data ${LXQT_MINIMUM_VERSION} REQUIRED)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ As indicated by the name, a volume control. Technically Alsa, OSS and PulseAudio

### Compiling source code

The runtime dependencies are libxcomposite, libdbusmenu-qt5, KGuiAddons, KWindowSystem, Solid, menu-cache, [lxqt-menu-data](https://github.com/lxqt/lxqt-menu-data), [liblxqt](https://github.com/lxqt/liblxqt) and [lxqt-globalkeys](https://github.com/lxqt/lxqt-globalkeys).
The runtime dependencies are libxcomposite, libdbusmenu-lxqt, KGuiAddons, KWindowSystem, Solid, menu-cache, [lxqt-menu-data](https://github.com/lxqt/lxqt-menu-data), [liblxqt](https://github.com/lxqt/liblxqt) and [lxqt-globalkeys](https://github.com/lxqt/lxqt-globalkeys).
Several plugins or features thereof are optional and need additional runtime dependencies. Namely these are (plugin / feature in parenthesis) Alsa library (Alsa support in plugin-volume), PulseAudio client library (PulseAudio support in plugin-volume), lm-sensors (plugin-sensors), libstatgrab (plugin-cpuload, plugin-networkmonitor), [libsysstat](https://github.com/lxqt/libsysstat) (plugin-sysstat). All of them are enabled by default and have to be disabled by CMake variables as required, see below.
In addition CMake and [lxqt-build-tools](https://github.com/lxqt/lxqt-build-tools) are mandatory build dependencies. Git is optionally needed to pull latest VCS checkouts.

Expand Down
8 changes: 4 additions & 4 deletions cmake/BuildPlugin.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ MACRO (BUILD_LXQT_PLUGIN NAME)
set (PLUGIN_DIR ${CMAKE_INSTALL_FULL_LIBDIR}/${PROGRAM})
endif (NOT DEFINED PLUGIN_DIR)

set(QTX_LIBRARIES Qt5::Widgets)
set(QTX_LIBRARIES Qt6::Widgets)
if(QT_USE_QTXML)
set(QTX_LIBRARIES ${QTX_LIBRARIES} Qt5::Xml)
set(QTX_LIBRARIES ${QTX_LIBRARIES} Qt6::Xml)
endif()
if(QT_USE_QTDBUS)
set(QTX_LIBRARIES ${QTX_LIBRARIES} Qt5::DBus)
set(QTX_LIBRARIES ${QTX_LIBRARIES} Qt6::DBus)
endif()

list(FIND STATIC_PLUGINS ${NAME} IS_STATIC)
Expand All @@ -52,7 +52,7 @@ MACRO (BUILD_LXQT_PLUGIN NAME)
else() # static
add_library(${NAME} STATIC ${SRC}) # build statically linked lib
endif()
target_link_libraries(${NAME} ${QTX_LIBRARIES} lxqt ${LIBRARIES} KF5::WindowSystem)
target_link_libraries(${NAME} ${QTX_LIBRARIES} lxqt ${LIBRARIES} KF6::WindowSystem)

install(FILES ${CONFIG_FILES} DESTINATION ${PLUGIN_SHARE_DIR})
install(FILES ${DESKTOP_FILES} DESTINATION ${PROG_SHARE_DIR})
Expand Down
4 changes: 2 additions & 2 deletions panel/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ endif ()

project(${PROJECT})

set(QTX_LIBRARIES Qt5::Widgets Qt5::Xml Qt5::DBus)
set(QTX_LIBRARIES Qt6::Widgets Qt6::Xml Qt6::DBus)

# Translations
lxqt_translate_ts(QM_FILES SOURCES
Expand Down Expand Up @@ -102,7 +102,7 @@ add_executable(${PROJECT}
target_link_libraries(${PROJECT}
${LIBRARIES}
${QTX_LIBRARIES}
KF5::WindowSystem
KF6::WindowSystem
${STATIC_PLUGINS}
)

Expand Down
2 changes: 1 addition & 1 deletion panel/config/configplacement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

#include "../lxqtpanellimits.h"

#include <KWindowSystem/KWindowSystem>
#include <KWindowSystem>
#include <QDebug>
#include <QListView>
#include <QScreen>
Expand Down
14 changes: 7 additions & 7 deletions panel/config/configpluginswidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ ConfigPluginsWidget::ConfigPluginsWidget(LXQtPanel *panel, QWidget* parent) :
{
ui->setupUi(this);

PanelPluginsModel * plugins = mPanel->mPlugins.data();
PanelPluginsModel * plugins = mPanel->mPlugins.get();
{
QScopedPointer<QItemSelectionModel> m(ui->listView_plugins->selectionModel());
std::unique_ptr<QItemSelectionModel> m(ui->listView_plugins->selectionModel());
ui->listView_plugins->setModel(plugins);
}
{
QScopedPointer<QAbstractItemDelegate> d(ui->listView_plugins->itemDelegate());
std::unique_ptr<QAbstractItemDelegate> d(ui->listView_plugins->itemDelegate());
ui->listView_plugins->setItemDelegate(new LXQt::HtmlDelegate(QSize(16, 16), ui->listView_plugins));
}

Expand Down Expand Up @@ -83,11 +83,11 @@ void ConfigPluginsWidget::reset()

void ConfigPluginsWidget::showAddPluginDialog()
{
if (mAddPluginDialog.isNull())
if (!mAddPluginDialog)
{
mAddPluginDialog.reset(new AddPluginDialog);
connect(mAddPluginDialog.data(), &AddPluginDialog::pluginSelected,
mPanel->mPlugins.data(), &PanelPluginsModel::addPlugin);
connect(mAddPluginDialog.get(), &AddPluginDialog::pluginSelected,
mPanel->mPlugins.get(), &PanelPluginsModel::addPlugin);
}
mAddPluginDialog->show();
mAddPluginDialog->raise();
Expand All @@ -96,7 +96,7 @@ void ConfigPluginsWidget::showAddPluginDialog()

void ConfigPluginsWidget::resetButtons()
{
PanelPluginsModel *model = mPanel->mPlugins.data();
PanelPluginsModel *model = mPanel->mPlugins.get();
QItemSelectionModel *selectionModel = ui->listView_plugins->selectionModel();
bool hasSelection = selectionModel->hasSelection();
bool isFirstSelected = selectionModel->isSelected(model->index(0));
Expand Down
2 changes: 1 addition & 1 deletion panel/config/configpluginswidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ private slots:

private:
Ui::ConfigPluginsWidget *ui;
QScopedPointer<AddPluginDialog> mAddPluginDialog;
std::unique_ptr<AddPluginDialog> mAddPluginDialog;
LXQtPanel *mPanel;
};

Expand Down
10 changes: 5 additions & 5 deletions panel/config/configstyling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

#include "../lxqtpanellimits.h"

#include <KWindowSystem/KWindowSystem>
#include <KWindowSystem>
#include <QDebug>
#include <QListView>
#include <QScreen>
Expand Down Expand Up @@ -77,9 +77,9 @@ ConfigStyling::ConfigStyling(LXQtPanel *panel, QWidget *parent) :
************************************************/
void ConfigStyling::reset()
{
mFontColor.setNamedColor(mOldFontColor.name());
mFontColor = QColor::fromString(mOldFontColor.name());
ui->pushButton_customFontColor->setStyleSheet(QStringLiteral("background: %1").arg(mOldFontColor.name()));
mBackgroundColor.setNamedColor(mOldBackgroundColor.name());
mBackgroundColor = QColor::fromString(mOldBackgroundColor.name());
ui->pushButton_customBgColor->setStyleSheet(QStringLiteral("background: %1").arg(mOldBackgroundColor.name()));
ui->lineEdit_customBgImage->setText(mOldBackgroundImage);
ui->slider_opacity->setValue(mOldOpacity);
Expand Down Expand Up @@ -190,7 +190,7 @@ void ConfigStyling::pickFontColor()
d.setWindowModality(Qt::WindowModal);
if (d.exec() && d.currentColor().isValid())
{
mFontColor.setNamedColor(d.currentColor().name());
mFontColor = QColor::fromString(d.currentColor().name());
ui->pushButton_customFontColor->setStyleSheet(QStringLiteral("background: %1").arg(mFontColor.name()));
editChanged();
}
Expand All @@ -206,7 +206,7 @@ void ConfigStyling::pickBackgroundColor()
d.setWindowModality(Qt::WindowModal);
if (d.exec() && d.currentColor().isValid())
{
mBackgroundColor.setNamedColor(d.currentColor().name());
mBackgroundColor = QColor::fromString(d.currentColor().name());
ui->pushButton_customBgColor->setStyleSheet(QStringLiteral("background: %1").arg(mBackgroundColor.name()));
editChanged();
}
Expand Down
22 changes: 11 additions & 11 deletions panel/lxqtpanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@

#include <QScreen>
#include <QWindow>
#include <QX11Info>
#include <QDebug>
#include <QString>
#include <QMenu>
Expand All @@ -49,9 +48,10 @@
#include <XdgIcon>
#include <XdgDirs>

#include <KWindowSystem/KWindowSystem>
#include <KWindowSystem/KX11Extras>
#include <KWindowSystem/NETWM>
#include <KWindowSystem>
#include <KX11Extras>
#include <NETWM>
#include <KWindowInfo>

// Turn on this to show the time required to load each plugin during startup
// #define DEBUG_PLUGIN_LOADTIME
Expand Down Expand Up @@ -221,8 +221,8 @@ LXQtPanel::LXQtPanel(const QString &configGroup, LXQt::Settings *settings, QWidg
connect(LXQt::Settings::globalSettings(), &LXQt::GlobalSettings::settingsChanged, this, [this] { update(); } );
connect(lxqtApp, &LXQt::Application::themeChanged, this, &LXQtPanel::realign);

connect(mStandaloneWindows.data(), &WindowNotifier::firstShown, this, [this] { showPanel(true); });
connect(mStandaloneWindows.data(), &WindowNotifier::lastHidden, this, &LXQtPanel::hidePanel);
connect(mStandaloneWindows.get(), &WindowNotifier::firstShown, this, [this] { showPanel(true); });
connect(mStandaloneWindows.get(), &WindowNotifier::lastHidden, this, &LXQtPanel::hidePanel);

readSettings();

Expand Down Expand Up @@ -446,11 +446,11 @@ void LXQtPanel::loadPlugins()
names_key += QLatin1String(CFG_KEY_PLUGINS);
mPlugins.reset(new PanelPluginsModel(this, names_key, pluginDesktopDirs()));

connect(mPlugins.data(), &PanelPluginsModel::pluginAdded, mLayout, &LXQtPanelLayout::addPlugin);
connect(mPlugins.data(), &PanelPluginsModel::pluginMovedUp, mLayout, &LXQtPanelLayout::moveUpPlugin);
connect(mPlugins.get(), &PanelPluginsModel::pluginAdded, mLayout, &LXQtPanelLayout::addPlugin);
connect(mPlugins.get(), &PanelPluginsModel::pluginMovedUp, mLayout, &LXQtPanelLayout::moveUpPlugin);
//reemit signals
connect(mPlugins.data(), &PanelPluginsModel::pluginAdded, this, &LXQtPanel::pluginAdded);
connect(mPlugins.data(), &PanelPluginsModel::pluginRemoved, this, &LXQtPanel::pluginRemoved);
connect(mPlugins.get(), &PanelPluginsModel::pluginAdded, this, &LXQtPanel::pluginAdded);
connect(mPlugins.get(), &PanelPluginsModel::pluginRemoved, this, &LXQtPanel::pluginRemoved);

const auto plugins = mPlugins->plugins();
for (auto const & plugin : plugins)
Expand Down Expand Up @@ -1127,7 +1127,7 @@ bool LXQtPanel::event(QEvent *event)
// Qt::WA_X11NetWmWindowTypeDock becomes ineffective in Qt 5
// See QTBUG-39887: https://bugreports.qt-project.org/browse/QTBUG-39887
// Let's use KWindowSystem for that
KWindowSystem::setType(effectiveWinId(), NET::Dock);
KX11Extras::setType(effectiveWinId(), NET::Dock);

updateWmStrut(); // reserve screen space for the panel
KX11Extras::setOnAllDesktops(effectiveWinId(), true);
Expand Down
4 changes: 2 additions & 2 deletions panel/lxqtpanel.h
Original file line number Diff line number Diff line change
Expand Up @@ -470,12 +470,12 @@ private slots:
* @brief Pointer to the PanelPluginsModel which will store all the Plugins
* that are loaded.
*/
QScopedPointer<PanelPluginsModel> mPlugins;
std::unique_ptr<PanelPluginsModel> mPlugins;
/**
* @brief object for storing info if some standalone window is shown
* (for preventing hide)
*/
QScopedPointer<WindowNotifier> mStandaloneWindows;
std::unique_ptr<WindowNotifier> mStandaloneWindows;

/**
* @brief Returns the screen index of a screen on which this panel could
Expand Down
10 changes: 5 additions & 5 deletions panel/lxqtpanelapplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ LXQtPanelApplicationPrivate::LXQtPanelApplicationPrivate(LXQtPanelApplication *q
ILXQtPanel::Position LXQtPanelApplicationPrivate::computeNewPanelPosition(const LXQtPanel *p, const int screenNum)
{
Q_Q(LXQtPanelApplication);
QVector<bool> screenPositions(4, false); // false means not occupied
QList<bool> screenPositions(4, false); // false means not occupied

for (int i = 0; i < q->mPanels.size(); ++i) {
if (p != q->mPanels.at(i)) {
Expand Down Expand Up @@ -131,7 +131,7 @@ LXQtPanelApplication::LXQtPanelApplication(int& argc, char** argv)
panels << QStringLiteral("panel1");
}

for(const QString& i : qAsConst(panels))
for(const QString& i : std::as_const(panels))
{
addPanel(i);
}
Expand Down Expand Up @@ -199,7 +199,7 @@ void LXQtPanelApplication::reloadPanelsAsNeeded()
for(const QString& name : names)
{
bool found = false;
for(LXQtPanel* panel : qAsConst(mPanels))
for(LXQtPanel* panel : std::as_const(mPanels))
{
if(panel->name() == name)
{
Expand Down Expand Up @@ -246,7 +246,7 @@ void LXQtPanelApplication::screenDestroyed(QObject* screenObj)
QScreen* screen = static_cast<QScreen*>(screenObj);
bool reloadNeeded = false;
qApp->setQuitOnLastWindowClosed(false);
for(LXQtPanel* panel : qAsConst(mPanels))
for(LXQtPanel* panel : std::as_const(mPanels))
{
QWindow* panelWindow = panel->windowHandle();
if(panelWindow && panelWindow->screen() == screen)
Expand Down Expand Up @@ -300,7 +300,7 @@ void LXQtPanelApplication::setIconTheme(const QString &iconTheme)
if (newTheme != QIcon::themeName())
{
QIcon::setThemeName(newTheme);
for(LXQtPanel* panel : qAsConst(mPanels))
for(LXQtPanel* panel : std::as_const(mPanels))
{
panel->update();
panel->updateConfigDialog();
Expand Down
8 changes: 4 additions & 4 deletions panel/lxqtpanellayout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ class LayoutItemGrid
void moveItem(int from, int to);

private:
QVector<LayoutItemInfo> mInfoItems;
QList<LayoutItemInfo> mInfoItems;
int mColCount;
int mUsedColCount;
int mRowCount;
Expand Down Expand Up @@ -218,7 +218,7 @@ void LayoutItemGrid::rebuild()
{
clear();

for(QLayoutItem *item : qAsConst(mItems))
for(QLayoutItem *item : std::as_const(mItems))
{
doAddToGrid(item);
}
Expand Down Expand Up @@ -648,7 +648,7 @@ void LXQtPanelLayout::setGeometryHoriz(const QRect &geometry)
}

// Calc baselines for plugins like button.
QVector<int> baseLines(qMax(mLeftGrid->colCount(), mRightGrid->colCount()));
QList<int> baseLines(qMax(mLeftGrid->colCount(), mRightGrid->colCount()));
const int bh = geometry.height() / baseLines.count();
const int base_center = bh >> 1;
const int height_remain = 0 < bh ? geometry.height() % baseLines.size() : 0;
Expand Down Expand Up @@ -787,7 +787,7 @@ void LXQtPanelLayout::setGeometryVert(const QRect &geometry)
}

// Calc baselines for plugins like button.
QVector<int> baseLines(qMax(mLeftGrid->colCount(), mRightGrid->colCount()));
QList<int> baseLines(qMax(mLeftGrid->colCount(), mRightGrid->colCount()));
const int bw = geometry.width() / baseLines.count();
const int base_center = bw >> 1;
const int width_remain = 0 < bw ? geometry.width() % baseLines.size() : 0;
Expand Down
1 change: 0 additions & 1 deletion panel/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
int main(int argc, char *argv[])
{
LXQtPanelApplication app(argc, argv);
app.setAttribute(Qt::AA_UseHighDpiPixmaps, true);

return app.exec();
}
2 changes: 1 addition & 1 deletion panel/panelpluginsmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ void PanelPluginsModel::loadPlugins(QStringList const & desktopDirs)
timer.start();
qint64 lastTime = 0;
#endif
for (auto const & name : qAsConst(plugin_names))
for (auto const & name : std::as_const(plugin_names))
{
pluginslist_t::iterator i = mPlugins.insert(mPlugins.end(), {name, nullptr});
QString type = mPanel->settings()->value(name + QStringLiteral("/type")).toString();
Expand Down
6 changes: 2 additions & 4 deletions panel/panelpluginsmodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ public slots:
*
* \sa mPlugins
*/
typedef QList<QPair <QString/*name*/, QPointer<Plugin> > > pluginslist_t;
typedef QList<std::pair <QString/*name*/, QPointer<Plugin> > > pluginslist_t;

private:
/*!
Expand Down Expand Up @@ -320,7 +320,7 @@ public slots:
* \brief mPlugins Stores all the Plugins.
*
* mPlugins is a QList of elements while each element corresponds to a
* single Plugin. Each element is a QPair of a QString and a QPointer
* single Plugin. Each element is a std::pair of a QString and a QPointer
* while the QPointer points to a Plugin.
*
* To access the elements, you can use indexing or an iterator on the
Expand All @@ -336,6 +336,4 @@ public slots:
LXQtPanel * mPanel;
};

Q_DECLARE_METATYPE(Plugin const *)

#endif // PANELPLUGINSMODEL_H
4 changes: 2 additions & 2 deletions panel/plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#include "pluginsettings_p.h"
#include "lxqtpanel.h"

#include <KWindowSystem/KX11Extras>
#include <KX11Extras>

#include <QDebug>
#include <QProcessEnvironment>
Expand Down Expand Up @@ -127,7 +127,7 @@ Plugin::Plugin(const LXQt::PluginInfo &desktopFile, LXQt::Settings *settings, co
else {
// this plugin is a dynamically loadable module
QString baseName = QStringLiteral("lib%1.so").arg(desktopFile.id());
for(const QString &dirName : qAsConst(dirs))
for(const QString &dirName : std::as_const(dirs))
{
QFileInfo fi(QDir(dirName), baseName);
if (fi.exists())
Expand Down
1 change: 1 addition & 0 deletions panel/plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,5 +130,6 @@ private slots:

};

Q_DECLARE_METATYPE(Plugin const *)

#endif // PLUGIN_H
Loading

0 comments on commit 64f8a5a

Please sign in to comment.