Compare commits
8 Commits
Author | SHA1 | Date |
---|---|---|
|
0c09f40ef7 | |
|
54f63188ca | |
|
cb02376cf6 | |
|
252d55e467 | |
|
2fb6be4e8d | |
|
5ac18b9d8f | |
|
a0efc8854f | |
|
b8692e2f16 |
|
@ -9,8 +9,8 @@ cmake_minimum_required(VERSION 3.1 FATAL_ERROR)
|
||||||
|
|
||||||
# KDE Application Version, managed by release script
|
# KDE Application Version, managed by release script
|
||||||
set (RELEASE_SERVICE_VERSION_MAJOR "20")
|
set (RELEASE_SERVICE_VERSION_MAJOR "20")
|
||||||
set (RELEASE_SERVICE_VERSION_MINOR "11")
|
set (RELEASE_SERVICE_VERSION_MINOR "12")
|
||||||
set (RELEASE_SERVICE_VERSION_MICRO "80")
|
set (RELEASE_SERVICE_VERSION_MICRO "1")
|
||||||
set (RELEASE_SERVICE_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE_VERSION_MINOR}.${RELEASE_SERVICE_VERSION_MICRO}")
|
set (RELEASE_SERVICE_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE_VERSION_MINOR}.${RELEASE_SERVICE_VERSION_MICRO}")
|
||||||
project(kpmcore VERSION ${RELEASE_SERVICE_VERSION})
|
project(kpmcore VERSION ${RELEASE_SERVICE_VERSION})
|
||||||
|
|
||||||
|
|
|
@ -158,6 +158,21 @@ QVariantMap ExternalCommandHelper::CopyBlocks(const QString& sourceDevice, const
|
||||||
if (!isCallerAuthorized()) {
|
if (!isCallerAuthorized()) {
|
||||||
return QVariantMap();
|
return QVariantMap();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Avoid division by zero further down
|
||||||
|
if (!blockSize) {
|
||||||
|
return QVariantMap();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Prevent some out of memory situations
|
||||||
|
constexpr qint64 MiB = 1 << 30;
|
||||||
|
if (blockSize > 100 * MiB) {
|
||||||
|
return QVariantMap();
|
||||||
|
}
|
||||||
|
if (targetDevice.isEmpty() && sourceLength > MiB) {
|
||||||
|
return QVariantMap();
|
||||||
|
}
|
||||||
|
|
||||||
QVariantMap reply;
|
QVariantMap reply;
|
||||||
reply[QStringLiteral("success")] = true;
|
reply[QStringLiteral("success")] = true;
|
||||||
|
|
||||||
|
@ -279,15 +294,16 @@ QVariantMap ExternalCommandHelper::RunCommand(const QString& command, const QStr
|
||||||
|
|
||||||
// connect(&cmd, &QProcess::readyReadStandardOutput, this, &ExternalCommandHelper::onReadOutput);
|
// connect(&cmd, &QProcess::readyReadStandardOutput, this, &ExternalCommandHelper::onReadOutput);
|
||||||
|
|
||||||
m_cmd.setEnvironment( { QStringLiteral("LVM_SUPPRESS_FD_WARNINGS=1") } );
|
QProcess cmd;
|
||||||
m_cmd.setProcessChannelMode(static_cast<QProcess::ProcessChannelMode>(processChannelMode));
|
cmd.setEnvironment( { QStringLiteral("LVM_SUPPRESS_FD_WARNINGS=1") } );
|
||||||
m_cmd.start(command, arguments);
|
cmd.setProcessChannelMode(static_cast<QProcess::ProcessChannelMode>(processChannelMode));
|
||||||
m_cmd.write(input);
|
cmd.start(command, arguments);
|
||||||
m_cmd.closeWriteChannel();
|
cmd.write(input);
|
||||||
m_cmd.waitForFinished(-1);
|
cmd.closeWriteChannel();
|
||||||
QByteArray output = m_cmd.readAllStandardOutput();
|
cmd.waitForFinished(-1);
|
||||||
|
QByteArray output = cmd.readAllStandardOutput();
|
||||||
reply[QStringLiteral("output")] = output;
|
reply[QStringLiteral("output")] = output;
|
||||||
reply[QStringLiteral("exitCode")] = m_cmd.exitCode();
|
reply[QStringLiteral("exitCode")] = cmd.exitCode();
|
||||||
|
|
||||||
return reply;
|
return reply;
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,7 +46,6 @@ private:
|
||||||
bool isCallerAuthorized();
|
bool isCallerAuthorized();
|
||||||
|
|
||||||
void onReadOutput();
|
void onReadOutput();
|
||||||
QProcess m_cmd;
|
|
||||||
QDBusServiceWatcher *m_serviceWatcher = nullptr;
|
QDBusServiceWatcher *m_serviceWatcher = nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -20,6 +20,7 @@ SPDX-License-Identifier: CC0-1.0
|
||||||
<description xml:lang="it">Avvia demone per comando esterno</description>
|
<description xml:lang="it">Avvia demone per comando esterno</description>
|
||||||
<description xml:lang="lt">Paleisti išorinių komandų tarnybą</description>
|
<description xml:lang="lt">Paleisti išorinių komandų tarnybą</description>
|
||||||
<description xml:lang="nl">Start externe opdrachtdaemon</description>
|
<description xml:lang="nl">Start externe opdrachtdaemon</description>
|
||||||
|
<description xml:lang="pl">Rozpocznij usługę zewnętrznego polecenia</description>
|
||||||
<description xml:lang="pt">Iniciar o servidor de comandos externos</description>
|
<description xml:lang="pt">Iniciar o servidor de comandos externos</description>
|
||||||
<description xml:lang="pt_BR">Iniciar comando externo do daemon</description>
|
<description xml:lang="pt_BR">Iniciar comando externo do daemon</description>
|
||||||
<description xml:lang="sl">Zaženi demon za zunanje ukaze</description>
|
<description xml:lang="sl">Zaženi demon za zunanje ukaze</description>
|
||||||
|
@ -36,6 +37,7 @@ SPDX-License-Identifier: CC0-1.0
|
||||||
<message xml:lang="it">Per gestire il disco sono richiesti privilegi amministrativi</message>
|
<message xml:lang="it">Per gestire il disco sono richiesti privilegi amministrativi</message>
|
||||||
<message xml:lang="lt">Diskų tvarkymui reikalingos administratoriaus teisės</message>
|
<message xml:lang="lt">Diskų tvarkymui reikalingos administratoriaus teisės</message>
|
||||||
<message xml:lang="nl">Er zijn administratieve rechten vereist om schijven te beheren</message>
|
<message xml:lang="nl">Er zijn administratieve rechten vereist om schijven te beheren</message>
|
||||||
|
<message xml:lang="pl">Do zarządzania dyskami wymagane są uprawnienia administratora</message>
|
||||||
<message xml:lang="pt">São necessários privilégios de administração para gerir os discos</message>
|
<message xml:lang="pt">São necessários privilégios de administração para gerir os discos</message>
|
||||||
<message xml:lang="pt_BR">São necessários privilégios administrativos para gerenciar discos</message>
|
<message xml:lang="pt_BR">São necessários privilégios administrativos para gerenciar discos</message>
|
||||||
<message xml:lang="sl">Za upravljanje diskov so potrebne pravice upravljavca računalnika</message>
|
<message xml:lang="sl">Za upravljanje diskov so potrebne pravice upravljavca računalnika</message>
|
||||||
|
|
Loading…
Reference in New Issue