summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2012-01-29 11:38:37 +0100
committerAndrea Diamantini <adjam7@gmail.com>2012-01-29 11:38:37 +0100
commit4baddd07b702f0277cc83dae08ac9c79a0cf412b (patch)
tree0ca874a31236f760e4beac8ee42b2dc41da8352b /src
parent"http://www." + digited host --> "http://" + digited host (diff)
downloadrekonq-4baddd07b702f0277cc83dae08ac9c79a0cf412b.tar.xz
Use UrlResolver in application class to uniform rekonq url resolution
BUG:290271
Diffstat (limited to 'src')
-rw-r--r--src/application.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/application.cpp b/src/application.cpp
index 2f716463..18d19d9d 100644
--- a/src/application.cpp
+++ b/src/application.cpp
@@ -210,14 +210,28 @@ int Application::newInstance()
if (areThereArguments)
{
+ // prepare URLS to load
KUrl::List urlList;
for (int i = 0; i < args->count(); ++i)
{
const KUrl u = args->url(i);
+
if (u.isLocalFile() && QFile::exists(u.toLocalFile())) // "rekonq somefile.html" case
urlList += u;
else
- urlList += KUrl(args->arg(i)); // "rekonq kde.org" || "rekonq kde:kdialog" case
+ {
+ // "rekonq kde.org" || "rekonq kde:kdialog" case
+ UrlResolver res(args->arg(i));
+ UrlSearchList list = res.orderedSearchItems();
+ if (list.isEmpty())
+ {
+ urlList += u;
+ }
+ else
+ {
+ urlList += list.first().url;
+ }
+ }
}
// first argument: 99% of the time we have just that...