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_externalExecutable = settings.value("ExternalManagerExecutable", QString()).toString();
|
||||||
m_externalArguments = settings.value("ExternalManagerArguments", QString()).toString();
|
m_externalArguments = settings.value("ExternalManagerArguments", QString()).toString();
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
|
|
||||||
|
if (!m_externalArguments.contains(QLatin1String("%d"))) {
|
||||||
|
m_externalArguments.append(QLatin1String(" %d"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DownloadManager::show()
|
void DownloadManager::show()
|
||||||
@ -101,7 +105,10 @@ void DownloadManager::keyPressEvent(QKeyEvent* e)
|
|||||||
|
|
||||||
void DownloadManager::startExternalManager(const QUrl &url)
|
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;
|
m_lastDownloadOption = ExternalManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2014,6 +2014,13 @@
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</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>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item row="9" column="0" colspan="4">
|
<item row="9" column="0" colspan="4">
|
||||||
|
@ -2812,6 +2812,10 @@
|
|||||||
<source>Choose cache path...</source>
|
<source>Choose cache path...</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source><b>%d</b> will be replaced with URL to be downloaded</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>QObject</name>
|
<name>QObject</name>
|
||||||
|
Loading…
Reference in New Issue
Block a user