1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 10:46:35 +01:00

Fixed potentional issue with starting external download manager

This commit is contained in:
nowrep 2012-07-06 20:22:08 +02:00
parent c0c996dbbd
commit 19f34ecd4c
6 changed files with 13 additions and 13 deletions

View File

@ -189,7 +189,7 @@ const AdBlockRule* AdBlockSubscription::match(const QNetworkRequest &request, co
{ {
int count = m_networkExceptionRules.count(); int count = m_networkExceptionRules.count();
for (int i = 0; i < count; ++i) { for (int i = 0; i < count; ++i) {
const AdBlockRule * rule = m_networkExceptionRules.at(i); const AdBlockRule* rule = m_networkExceptionRules.at(i);
if (rule->networkMatch(request, urlDomain, urlString)) { if (rule->networkMatch(request, urlDomain, urlString)) {
return 0; return 0;
} }
@ -197,7 +197,7 @@ const AdBlockRule* AdBlockSubscription::match(const QNetworkRequest &request, co
count = m_networkBlockRules.count(); count = m_networkBlockRules.count();
for (int i = 0; i < count; ++i) { for (int i = 0; i < count; ++i) {
const AdBlockRule * rule = m_networkBlockRules.at(i); const AdBlockRule* rule = m_networkBlockRules.at(i);
if (rule->networkMatch(request, urlDomain, urlString)) { if (rule->networkMatch(request, urlDomain, urlString)) {
return rule; return rule;
} }
@ -210,7 +210,7 @@ bool AdBlockSubscription::adBlockDisabledForUrl(const QUrl &url) const
{ {
int count = m_documentRules.count(); int count = m_documentRules.count();
for (int i = 0; i < count; ++i) { for (int i = 0; i < count; ++i) {
const AdBlockRule * rule = m_documentRules.at(i); const AdBlockRule* rule = m_documentRules.at(i);
if (rule->urlMatch(url)) { if (rule->urlMatch(url)) {
return true; return true;
} }
@ -227,7 +227,7 @@ bool AdBlockSubscription::elemHideDisabledForUrl(const QUrl &url) const
int count = m_elemhideRules.count(); int count = m_elemhideRules.count();
for (int i = 0; i < count; ++i) { for (int i = 0; i < count; ++i) {
const AdBlockRule * rule = m_elemhideRules.at(i); const AdBlockRule* rule = m_elemhideRules.at(i);
if (rule->urlMatch(url)) { if (rule->urlMatch(url)) {
return true; return true;
} }
@ -247,7 +247,7 @@ QString AdBlockSubscription::elementHidingRulesForDomain(const QString &domain)
int count = m_domainRestrictedCssRules.count(); int count = m_domainRestrictedCssRules.count();
for (int i = 0; i < count; ++i) { for (int i = 0; i < count; ++i) {
const AdBlockRule * rule = m_domainRestrictedCssRules.at(i); const AdBlockRule* rule = m_domainRestrictedCssRules.at(i);
if (rule->matchDomain(domain)) { if (rule->matchDomain(domain)) {
rules.append(rule->cssSelector() + ","); rules.append(rule->cssSelector() + ",");
} }

View File

@ -102,13 +102,13 @@ void DownloadManager::keyPressEvent(QKeyEvent* e)
void DownloadManager::startExternalManager(const QUrl &url) void DownloadManager::startExternalManager(const QUrl &url)
{ {
QStringList arguments = m_externalArguments.split(" "); QStringList arguments = m_externalArguments.split(' ', QString::SkipEmptyParts);
arguments << url.toString(); arguments << url.toString();
bool success = QProcess::startDetached(m_externalExecutable, arguments); bool success = QProcess::startDetached(m_externalExecutable, arguments);
if (!success) { if (!success) {
QString info = "<ul><li><b>" + tr("Executable: ") + "</b>" + m_externalExecutable + "</li><li><b>" + tr("Arguments: ") + "</b>" + arguments.join(" ") + "</li></ul>"; QString info = "<ul><li><b>" + tr("Executable: ") + "</b>" + m_externalExecutable + "</li><li><b>" + tr("Arguments: ") + "</b>" + arguments.join(' ') + "</li></ul>";
QMessageBox::critical(this, tr("Cannot start external download manager"), tr("Cannot start external download manager! %1").arg(info)); QMessageBox::critical(this, tr("Cannot start external download manager"), tr("Cannot start external download manager! %1").arg(info));
} }
} }

View File

@ -414,7 +414,7 @@ QString QupZillaSchemeReply::configPage()
} }
case QVariant::StringList: case QVariant::StringList:
keyString = keyValue.toStringList().join(","); keyString = keyValue.toStringList().join(',');
break; break;
default: default:

View File

@ -38,12 +38,12 @@ Updater::Version Updater::parseVersionFromString(const QString &string)
Version ver; Version ver;
ver.isValid = false; ver.isValid = false;
QStringList v = string.split("."); QStringList v = string.split('.');
if (v.count() != 3) { if (v.count() != 3) {
return ver; return ver;
} }
QStringList r = v.at(2).split("-"); QStringList r = v.at(2).split('.');
ver.majorVersion = v.at(0).toInt(); ver.majorVersion = v.at(0).toInt();
ver.minorVersion = v.at(1).toInt(); ver.minorVersion = v.at(1).toInt();

View File

@ -398,7 +398,7 @@ Preferences::Preferences(QupZilla* mainClass, QWidget* parent)
ui->httpsProxyUsername->setText(settings.value("HttpsUsername", "").toString()); ui->httpsProxyUsername->setText(settings.value("HttpsUsername", "").toString());
ui->httpsProxyPassword->setText(settings.value("HttpsPassword", "").toString()); ui->httpsProxyPassword->setText(settings.value("HttpsPassword", "").toString());
ui->proxyExceptions->setText(settings.value("ProxyExceptions", QStringList() << "localhost" << "127.0.0.1").toStringList().join(",")); ui->proxyExceptions->setText(settings.value("ProxyExceptions", QStringList() << "localhost" << "127.0.0.1").toStringList().join(','));
settings.endGroup(); settings.endGroup();
useDifferentProxyForHttpsChanged(ui->useHttpsProxy->isChecked()); useDifferentProxyForHttpsChanged(ui->useHttpsProxy->isChecked());
@ -905,7 +905,7 @@ void Preferences::saveSettings()
settings.setValue("HttpsUsername", ui->httpsProxyUsername->text()); settings.setValue("HttpsUsername", ui->httpsProxyUsername->text());
settings.setValue("HttpsPassword", ui->httpsProxyPassword->text()); settings.setValue("HttpsPassword", ui->httpsProxyPassword->text());
settings.setValue("ProxyExceptions", ui->proxyExceptions->text().split(",")); settings.setValue("ProxyExceptions", ui->proxyExceptions->text().split(','));
settings.endGroup(); settings.endGroup();
//Profiles //Profiles

View File

@ -33,7 +33,7 @@
bool startExternalProcess(const QString &program, const QStringList &arguments) bool startExternalProcess(const QString &program, const QStringList &arguments)
{ {
if (!QProcess::startDetached(program, arguments)) { if (!QProcess::startDetached(program, arguments)) {
QString info = "<ul><li><b>" + RSSNotification::tr("Executable: ") + "</b>" + program + "</li><li><b>" + RSSNotification::tr("Arguments: ") + "</b>" + arguments.join(" ") + "</li></ul>"; QString info = "<ul><li><b>" + RSSNotification::tr("Executable: ") + "</b>" + program + "</li><li><b>" + RSSNotification::tr("Arguments: ") + "</b>" + arguments.join(' ') + "</li></ul>";
QMessageBox::critical(0, RSSNotification::tr("Cannot start external program"), RSSNotification::tr("Cannot start external program! %1").arg(info)); QMessageBox::critical(0, RSSNotification::tr("Cannot start external program"), RSSNotification::tr("Cannot start external program! %1").arg(info));
return false; return false;