Skip to content

Commit

Permalink
Bump minimum required Qt version to 5.15
Browse files Browse the repository at this point in the history
  • Loading branch information
luis-pereira committed May 3, 2021
1 parent 11b0339 commit 7c0478e
Show file tree
Hide file tree
Showing 13 changed files with 1 addition and 86 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)

set(REQUIRED_QT_VERSION "5.12")
set(REQUIRED_QT_VERSION "5.15.0")
set(KF5_MINIMUM_VERSION "5.36.0")
set(LXQT_GLOBALKEYS_MINIMUM_VERSION "0.17.0")
set(LXQT_MINIMUM_VERSION "0.17.0")
Expand Down
4 changes: 0 additions & 4 deletions panel/config/addplugindialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,7 @@ AddPluginDialog::AddPluginDialog(QWidget *parent):
ui->setupUi(this);

QStringList desktopFilesDirs;
#if (QT_VERSION >= QT_VERSION_CHECK(5,15,0))
desktopFilesDirs << QString::fromLocal8Bit(qgetenv("LXQT_PANEL_PLUGINS_DIR")).split(QLatin1Char(':'), Qt::SkipEmptyParts);
#else
desktopFilesDirs << QString::fromLocal8Bit(qgetenv("LXQT_PANEL_PLUGINS_DIR")).split(QLatin1Char(':'), QString::SkipEmptyParts);
#endif
desktopFilesDirs << QStringLiteral("%1/%2").arg(XdgDirs::dataHome(), QStringLiteral("/lxqt/lxqt-panel"));
desktopFilesDirs << QStringLiteral(PLUGIN_DESKTOPS_DIR);

Expand Down
8 changes: 0 additions & 8 deletions panel/lxqtpanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -430,11 +430,7 @@ void LXQtPanel::show()
QStringList pluginDesktopDirs()
{
QStringList dirs;
#if (QT_VERSION >= QT_VERSION_CHECK(5,15,0))
dirs << QString::fromLocal8Bit(qgetenv("LXQT_PANEL_PLUGINS_DIR")).split(QLatin1Char(':'), Qt::SkipEmptyParts);
#else
dirs << QString::fromLocal8Bit(qgetenv("LXQT_PANEL_PLUGINS_DIR")).split(QLatin1Char(':'), QString::SkipEmptyParts);
#endif
dirs << QStringLiteral("%1/%2").arg(XdgDirs::dataHome(), QStringLiteral("/lxqt/lxqt-panel"));
dirs << QStringLiteral(PLUGIN_DESKTOPS_DIR);
return dirs;
Expand Down Expand Up @@ -1127,11 +1123,7 @@ bool LXQtPanel::event(QEvent *event)
// Sometimes Qt needs to re-create the underlying window of the widget and
// the winId() may be changed at runtime. So we need to reset all X11 properties
// when this happens.
#if (QT_VERSION >= QT_VERSION_CHECK(5,14,0))
qDebug() << "WinIdChange" << Qt::hex << effectiveWinId() << "handle" << windowHandle() << windowHandle()->screen();
#else
qDebug() << "WinIdChange" << hex << effectiveWinId() << "handle" << windowHandle() << windowHandle()->screen();
#endif

// Qt::WA_X11NetWmWindowTypeDock becomes ineffective in Qt 5
// See QTBUG-39887: https://bugreports.qt-project.org/browse/QTBUG-39887
Expand Down
8 changes: 0 additions & 8 deletions panel/panelpluginsmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -319,11 +319,7 @@ void PanelPluginsModel::onMovePluginUp(QModelIndex const & index)
return; //can't move up

beginMoveRows(QModelIndex(), row, row, QModelIndex(), row - 1);
#if (QT_VERSION >= QT_VERSION_CHECK(5,13,0))
mPlugins.swapItemsAt(row - 1, row);
#else
mPlugins.swap(row - 1, row);
#endif
endMoveRows();
pluginslist_t::const_reference moved_plugin = mPlugins[row - 1];
pluginslist_t::const_reference prev_plugin = mPlugins[row];
Expand All @@ -346,11 +342,7 @@ void PanelPluginsModel::onMovePluginDown(QModelIndex const & index)
return; //can't move down

beginMoveRows(QModelIndex(), row, row, QModelIndex(), row + 2);
#if (QT_VERSION >= QT_VERSION_CHECK(5,13,0))
mPlugins.swapItemsAt(row, row + 1);
#else
mPlugins.swap(row, row + 1);
#endif
endMoveRows();
pluginslist_t::const_reference moved_plugin = mPlugins[row + 1];
pluginslist_t::const_reference next_plugin = mPlugins[row];
Expand Down
11 changes: 0 additions & 11 deletions plugin-desktopswitch/desktopswitch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,7 @@ DesktopSwitch::DesktopSwitch(const ILXQtPanelPluginStartupInfo &startupInfo) :
{
m_buttons = new QButtonGroup(this);

#if (QT_VERSION >= QT_VERSION_CHECK(5,15,0))
connect (m_pSignalMapper, &QSignalMapper::mappedInt, this, &DesktopSwitch::setDesktop);
#else
connect (m_pSignalMapper, QOverload<int>::of(&QSignalMapper::mapped), this, &DesktopSwitch::setDesktop);
#endif


mLayout = new LXQt::GridLayout(&mWidget);
Expand All @@ -69,14 +65,7 @@ DesktopSwitch::DesktopSwitch(const ILXQtPanelPluginStartupInfo &startupInfo) :
onCurrentDesktopChanged(KWindowSystem::currentDesktop());
QTimer::singleShot(0, this, SLOT(registerShortcuts()));

#if (QT_VERSION >= QT_VERSION_CHECK(5,15,0))
connect(m_buttons, &QButtonGroup::idClicked, this, &DesktopSwitch::setDesktop);
#else
connect(m_buttons, QOverload<QAbstractButton *>::of(&QButtonGroup::buttonClicked), this, [=](QAbstractButton * /*button*/){
int id = m_buttons->checkedId();
setDesktop(id);
});
#endif

connect(KWindowSystem::self(), &KWindowSystem::numberOfDesktopsChanged, this, &DesktopSwitch::onNumberOfDesktopsChanged);
connect(KWindowSystem::self(), &KWindowSystem::currentDesktopChanged, this, &DesktopSwitch::onCurrentDesktopChanged);
Expand Down
19 changes: 0 additions & 19 deletions plugin-directorymenu/directorymenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,9 @@ DirectoryMenu::DirectoryMenu(const ILXQtPanelPluginStartupInfo &startupInfo) :

connect(&mButton, &QToolButton::clicked, this, &DirectoryMenu::showMenu);

#if (QT_VERSION >= QT_VERSION_CHECK(5,15,0))
connect(mOpenDirectorySignalMapper, &QSignalMapper::mappedString, this, &DirectoryMenu::openDirectory);
connect(mOpenTerminalSignalMapper, &QSignalMapper::mappedString, this, &DirectoryMenu::openInTerminal);
connect(mMenuSignalMapper, &QSignalMapper::mappedString, this, &DirectoryMenu::addMenu);
#else
connect(&mButton, SIGNAL(clicked()), this, SLOT(showMenu()));
connect(mOpenDirectorySignalMapper, SIGNAL(mapped(QString)), this, SLOT(openDirectory(QString)));
connect(mOpenTerminalSignalMapper, SIGNAL(mapped(QString)), this, SLOT(openInTerminal(QString)));
connect(mMenuSignalMapper, SIGNAL(mapped(QString)), this, SLOT(addMenu(QString)));
#endif

settingsChanged();
}
Expand Down Expand Up @@ -131,19 +124,11 @@ void DirectoryMenu::addActions(QMenu* menu, const QString& path)
mPathStrings.push_back(path);

QAction* openDirectoryAction = menu->addAction(XdgIcon::fromTheme(QStringLiteral("folder")), tr("Open"));
#if (QT_VERSION >= QT_VERSION_CHECK(5,15,0))
connect(openDirectoryAction, &QAction::triggered, mOpenDirectorySignalMapper, [this] { mOpenDirectorySignalMapper->map(); } );
#else
connect(openDirectoryAction, SIGNAL(triggered()), mOpenDirectorySignalMapper, SLOT(map()));
#endif
mOpenDirectorySignalMapper->setMapping(openDirectoryAction, mPathStrings.back());

QAction* openTerminalAction = menu->addAction(XdgIcon::fromTheme(QStringLiteral("folder")), tr("Open in terminal"));
#if (QT_VERSION >= QT_VERSION_CHECK(5,15,0))
connect(openTerminalAction, &QAction::triggered, mOpenTerminalSignalMapper, [this] { mOpenTerminalSignalMapper->map(); } );
#else
connect(openTerminalAction, SIGNAL(triggered()), mOpenTerminalSignalMapper, SLOT(map()));
#endif
mOpenTerminalSignalMapper->setMapping(openTerminalAction, mPathStrings.back());

menu->addSeparator();
Expand All @@ -159,11 +144,7 @@ void DirectoryMenu::addActions(QMenu* menu, const QString& path)

QMenu* subMenu = menu->addMenu(XdgIcon::fromTheme(QStringLiteral("folder")), mPathStrings.back());

#if (QT_VERSION >= QT_VERSION_CHECK(5,15,0))
connect(subMenu, &QMenu::aboutToShow, mMenuSignalMapper, [this] { mMenuSignalMapper->map(); } );
#else
connect(subMenu, SIGNAL(aboutToShow()), mMenuSignalMapper, SLOT(map()));
#endif
mMenuSignalMapper->setMapping(subMenu, entry.absoluteFilePath());
}
}
Expand Down
5 changes: 0 additions & 5 deletions plugin-quicklaunch/lxqtquicklaunch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,13 +198,8 @@ void LXQtQuickLaunch::dropEvent(QDropEvent *e)
return;
}

#if (QT_VERSION >= QT_VERSION_CHECK(5,14,0))
const auto & urls = e->mimeData()->urls();
for (const QUrl &url : QSet<QUrl>{urls.cbegin(), urls.cend()})
#else
const auto urls = e->mimeData()->urls().toSet();
for (const QUrl &url : urls)
#endif
{
QString fileName(url.isLocalFile() ? url.toLocalFile() : url.url());
QFileInfo fi(fileName);
Expand Down
4 changes: 0 additions & 4 deletions plugin-quicklaunch/quicklaunchaction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,8 @@ void QuickLaunchAction::execAction(QString additionalAction)
{
case ActionLegacy:
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,15,0))
QStringList args = QProcess::splitCommand(exec);
QProcess::startDetached(args.takeFirst(), args);
#else
QProcess::startDetached(exec);
#endif
break;
}
case ActionXdg:
Expand Down
10 changes: 0 additions & 10 deletions plugin-statusnotifier/statusnotifierbutton.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,6 @@
#include <QMenu>
#include <QTimer>

#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0)
template <typename T> inline T qFromUnaligned(const uchar *src)
{
T dest;
const size_t size = sizeof(T);
memcpy(&dest, src, size);
return dest;
}
#endif

class ILXQtPanelPlugin;
class SniAsync;

Expand Down
4 changes: 0 additions & 4 deletions plugin-sysstat/lxqtsysstatcolours.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,7 @@ LXQtSysStatColours::LXQtSysStatColours(QWidget *parent) :
++iterator;
}

#if (QT_VERSION >= QT_VERSION_CHECK(5,15,0))
connect(mSelectColourMapper, &QSignalMapper::mappedString, this, &LXQtSysStatColours::selectColour);
#else
connect(mSelectColourMapper, QOverload<const QString &>::of(&QSignalMapper::mapped), this, &LXQtSysStatColours::selectColour);
#endif
}

LXQtSysStatColours::~LXQtSysStatColours()
Expand Down
4 changes: 0 additions & 4 deletions plugin-taskbar/lxqttaskbar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,7 @@ LXQtTaskBar::LXQtTaskBar(ILXQtPanelPlugin *plugin, QWidget *parent) :
QTimer::singleShot(0, this, &LXQtTaskBar::settingsChanged);
setAcceptDrops(true);

#if (QT_VERSION >= QT_VERSION_CHECK(5,15,0))
connect(mSignalMapper, &QSignalMapper::mappedInt, this, &LXQtTaskBar::activateTask);
#else
connect(mSignalMapper, static_cast<void (QSignalMapper::*)(int)>(&QSignalMapper::mapped), this, &LXQtTaskBar::activateTask);
#endif
QTimer::singleShot(0, this, &LXQtTaskBar::registerShortcuts);

connect(KWindowSystem::self(), static_cast<void (KWindowSystem::*)(WId, NET::Properties, NET::Properties2)>(&KWindowSystem::windowChanged)
Expand Down
4 changes: 0 additions & 4 deletions plugin-taskbar/lxqttaskbutton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,7 @@ void LXQtTaskButton::updateIcon()
}
if (ico.isNull())
{
#if QT_VERSION >= 0x050600
int devicePixels = mIconSize * devicePixelRatioF();
#else
int devicePixels = mIconSize * devicePixelRatio();
#endif
ico = KWindowSystem::icon(mWindow, devicePixels, devicePixels);
}
setIcon(ico.isNull() ? XdgIcon::defaultApplicationIcon() : ico);
Expand Down
4 changes: 0 additions & 4 deletions plugin-volume/alsaengine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,11 +178,7 @@ void AlsaEngine::discoverDevices()
struct pollfd pfd;
if (snd_mixer_poll_descriptors(mixer, &pfd, 1)) {
QSocketNotifier *notifier = new QSocketNotifier(pfd.fd, QSocketNotifier::Read, this);
#if (QT_VERSION >= QT_VERSION_CHECK(5,15,0))
connect(notifier, &QSocketNotifier::activated, this, [this] (QSocketDescriptor socket, QSocketNotifier::Type) { this->driveAlsaEventHandling(socket); });
#else
connect(notifier, SIGNAL(activated(int)), this, SLOT(driveAlsaEventHandling(int)));
#endif
m_mixerMap.insert(pfd.fd, mixer);
}

Expand Down

0 comments on commit 7c0478e

Please sign in to comment.