From ac14a94f684982ce7c3016753c2cddd950025179 Mon Sep 17 00:00:00 2001 From: Toni Gundogdu Date: Sun, 30 Oct 2011 12:25:27 +0200 Subject: [PATCH] Fix umph integration * umph returned "nothing found" even with feeds with items * Make nn::to_cmd_args use QString::SkipEmptyParts --- src/i/MainWindow.cpp | 3 +++ src/util/nutil.cpp | 11 +++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/i/MainWindow.cpp b/src/i/MainWindow.cpp index 37c9445..5ebd2a1 100644 --- a/src/i/MainWindow.cpp +++ b/src/i/MainWindow.cpp @@ -699,6 +699,9 @@ void MainWindow::onFeed() .simplified(); QStringList args = nn::to_cmd_args(p); +#ifdef ENABLE_VERBOSE + qDebug() << __PRETTY_FUNCTION__ << __LINE__ << "args=" << args; +#endif const QString r = args.first(); if (r.isEmpty()) diff --git a/src/util/nutil.cpp b/src/util/nutil.cpp index 31dbb5f..3f23b6d 100644 --- a/src/util/nutil.cpp +++ b/src/util/nutil.cpp @@ -134,17 +134,20 @@ QStringList to_cmd_args(const QString& s) // $cmd_path:$cmd_args - if (s.simplified().contains(NSETTINGS_CMDPATH_SEPARATOR)) + static const QString::SplitBehavior sb = QString::SkipEmptyParts; + static const QString sep = NSETTINGS_CMDPATH_SEPARATOR; + + if (s.simplified().contains(sep)) { - QStringList r, a = s.simplified().split(NSETTINGS_CMDPATH_SEPARATOR); + QStringList r, a = s.simplified().split(sep); r << a.takeFirst(); - r << a.takeFirst().split(" "); + r << a.takeFirst().split(" ", sb); return r; } // "Other" value. - return s.simplified().split(" "); + return s.simplified().split(" ", sb); } } // namespace nn -- 2.11.4.GIT