mirror of
https://invent.kde.org/system/dolphin
synced 2024-08-22 01:40:02 +00:00
Merge branch 'release/20.04'
This commit is contained in:
commit
fa3f3a475d
|
@ -33,6 +33,9 @@
|
||||||
#include <QMimeData>
|
#include <QMimeData>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
|
#include <QMutex>
|
||||||
|
|
||||||
|
Q_GLOBAL_STATIC_WITH_ARGS(QMutex, s_collatorMutex, (QMutex::Recursive))
|
||||||
|
|
||||||
// #define KFILEITEMMODEL_DEBUG
|
// #define KFILEITEMMODEL_DEBUG
|
||||||
|
|
||||||
|
@ -1878,6 +1881,8 @@ int KFileItemModel::sortRoleCompare(const ItemData* a, const ItemData* b, const
|
||||||
|
|
||||||
int KFileItemModel::stringCompare(const QString& a, const QString& b, const QCollator& collator) const
|
int KFileItemModel::stringCompare(const QString& a, const QString& b, const QCollator& collator) const
|
||||||
{
|
{
|
||||||
|
QMutexLocker collatorLock(s_collatorMutex());
|
||||||
|
|
||||||
if (m_naturalSorting) {
|
if (m_naturalSorting) {
|
||||||
return collator.compare(a, b);
|
return collator.compare(a, b);
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,7 @@ add_definitions(-DTRANSLATION_DOMAIN=\"dolphin_servicemenuinstaller\")
|
||||||
add_executable(servicemenuinstaller servicemenuinstaller.cpp)
|
add_executable(servicemenuinstaller servicemenuinstaller.cpp)
|
||||||
target_link_libraries(servicemenuinstaller PRIVATE
|
target_link_libraries(servicemenuinstaller PRIVATE
|
||||||
Qt5::Core
|
Qt5::Core
|
||||||
|
Qt5::Gui
|
||||||
KF5::I18n
|
KF5::I18n
|
||||||
)
|
)
|
||||||
install(TARGETS servicemenuinstaller ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
|
install(TARGETS servicemenuinstaller ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
|
||||||
|
|
|
@ -25,6 +25,9 @@
|
||||||
#include <QDirIterator>
|
#include <QDirIterator>
|
||||||
#include <QCommandLineParser>
|
#include <QCommandLineParser>
|
||||||
#include <QMimeDatabase>
|
#include <QMimeDatabase>
|
||||||
|
#include <QUrl>
|
||||||
|
#include <QDesktopServices>
|
||||||
|
#include <QGuiApplication>
|
||||||
|
|
||||||
#include <KLocalizedString>
|
#include <KLocalizedString>
|
||||||
|
|
||||||
|
@ -201,6 +204,10 @@ bool cmdInstall(const QString &archive, QString &errorText)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
const QStringList binaryPackages = {"application/vnd.debian.binary-package", "application/x-rpm"};
|
||||||
|
if (binaryPackages.contains(QMimeDatabase().mimeTypeForFile(archive).name())) {
|
||||||
|
return QDesktopServices::openUrl(QUrl(archive));
|
||||||
|
}
|
||||||
const QString dir = generateDirPath(archive);
|
const QString dir = generateDirPath(archive);
|
||||||
if (QFile::exists(dir)) {
|
if (QFile::exists(dir)) {
|
||||||
if (!QDir(dir).removeRecursively()) {
|
if (!QDir(dir).removeRecursively()) {
|
||||||
|
@ -318,7 +325,7 @@ bool cmdUninstall(const QString &archive, QString &errorText)
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
QCoreApplication app(argc, argv);
|
QGuiApplication app(argc, argv);
|
||||||
|
|
||||||
QCommandLineParser parser;
|
QCommandLineParser parser;
|
||||||
parser.addPositionalArgument(QStringLiteral("command"), i18nc("@info:shell", "Command to execute: install or uninstall."));
|
parser.addPositionalArgument(QStringLiteral("command"), i18nc("@info:shell", "Command to execute: install or uninstall."));
|
||||||
|
|
Loading…
Reference in a new issue