mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 02:36:34 +01:00
Improved arguments parsing in external download manager.
Option to choose where exactly to put url (%d placeholder) instead of just appending it at the end of arguments.
This commit is contained in:
parent
e4ebeb3252
commit
8c9f09b17a
@ -75,6 +75,10 @@ void DownloadManager::loadSettings()
|
||||
m_externalExecutable = settings.value("ExternalManagerExecutable", QString()).toString();
|
||||
m_externalArguments = settings.value("ExternalManagerArguments", QString()).toString();
|
||||
settings.endGroup();
|
||||
|
||||
if (!m_externalArguments.contains(QLatin1String("%d"))) {
|
||||
m_externalArguments.append(QLatin1String(" %d"));
|
||||
}
|
||||
}
|
||||
|
||||
void DownloadManager::show()
|
||||
@ -101,7 +105,10 @@ void DownloadManager::keyPressEvent(QKeyEvent* e)
|
||||
|
||||
void DownloadManager::startExternalManager(const QUrl &url)
|
||||
{
|
||||
QzTools::startExternalProcess(m_externalExecutable, m_externalArguments + url.toEncoded());
|
||||
QString arguments = m_externalArguments;
|
||||
arguments.replace(QLatin1String("%d"), url.toEncoded());
|
||||
|
||||
QzTools::startExternalProcess(m_externalExecutable, arguments);
|
||||
m_lastDownloadOption = ExternalManager;
|
||||
}
|
||||
|
||||
|
@ -2014,6 +2014,13 @@
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QLabel" name="label_64">
|
||||
<property name="text">
|
||||
<string><b>%d</b> will be replaced with URL to be downloaded</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="9" column="0" colspan="4">
|
||||
|
@ -2812,6 +2812,10 @@
|
||||
<source>Choose cache path...</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source><b>%d</b> will be replaced with URL to be downloaded</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>QObject</name>
|
||||
|
Loading…
Reference in New Issue
Block a user