[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/KDE/3.5/kdegraphics/kdvi
From:       Wilfried Huss <Wilfried.Huss () gmx ! at>
Date:       2005-08-10 19:16:57
Message-ID: 1123701417.267158.6028.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 445254 by whuss:

Add gotopage option.

 M  +14 -2     main.cpp  


--- branches/KDE/3.5/kdegraphics/kdvi/main.cpp #445253:445254
@@ -15,8 +15,9 @@
 
 static KCmdLineOptions options[] =
 {
-  { "unique", I18N_NOOP("Check if the file is loaded in another KDVI. If it is, \
bring up the other KDVI. Otherwise, load the file."), 0 }, +  { "unique", \
I18N_NOOP("Check if the file is loaded in another KDVI.\nIf it is, bring up the other \
KDVI. Otherwise, load the file."), 0 },  { "paper ", I18N_NOOP("Sets paper size (not \
implemented at the moment, only for compatibility with lyx)"), 0 }, +  { "goto \
<pagenumber>", I18N_NOOP("Navigate to this page"), 0 },  { "+file(s)", \
I18N_NOOP("Files to load"), 0 },  KCmdLineLastOption
 };
@@ -132,7 +133,18 @@
     app.processEvents();
 
     if (args->count() > 0)
-      shell->openURL(args->url(0));
+    {
+      KURL url = args->url(0);
+      if (!url.hasRef() && args->isSet("goto"))
+      {
+        // If the url doesn't already has a reference part, add the
+        // argument of --goto to the url as reference, to make the
+        // KViewShell jump to this page.
+        QString reference = args->getOption("goto");
+        url.setHTMLRef(reference);
+      }
+      shell->openURL(url);
+    }
   }
 
   return app.exec();


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic