Browse Source

Fixed code for searching for help handbooks. This resolves bug 1839.

Michele Calgaro 4 years ago
parent
commit
37906b5b72
1 changed files with 11 additions and 17 deletions
  1. 11
    17
      kdoctools/tdeio_help.cpp

+ 11
- 17
kdoctools/tdeio_help.cpp View File

@@ -37,7 +37,7 @@
37 37
 
38 38
 using namespace TDEIO;
39 39
 
40
-TQString HelpProtocol::langLookup(const TQString& fname)
40
+TQString HelpProtocol::langLookup(const TQString &fname)
41 41
 {
42 42
     TQStringList search;
43 43
 
@@ -88,23 +88,17 @@ TQString HelpProtocol::langLookup(const TQString& fname)
88 88
 }
89 89
 
90 90
 
91
-TQString HelpProtocol::lookupFile(const TQString &fname,
92
-                                 const TQString &query, bool &redirect)
91
+TQString HelpProtocol::lookupFile(const TQString &fname, const TQString &query, bool &redirect)
93 92
 {
94 93
     redirect = false;
95
-
96
-    TQString path, result;
97
-
98
-    path = fname;
99
-
100
-    result = langLookup(path);
94
+    TQString result = langLookup(fname);
101 95
     if (result.isEmpty())
102 96
     {
103
-        result = langLookup(path+"/index.html");
97
+        result = langLookup(fname+"/index.html");
104 98
         if (!result.isEmpty())
105 99
         {
106
-            KURL red( "help:/" );
107
-            red.setPath( path + "/index.html" );
100
+            KURL red("help:/");
101
+            red.setPath( fname+"/index.html" );
108 102
             red.setQuery( query );
109 103
             redirection(red);
110 104
             kdDebug( 7119 ) << "redirect to " << red.url() << endl;
@@ -112,11 +106,11 @@ TQString HelpProtocol::lookupFile(const TQString &fname,
112 106
         }
113 107
         else
114 108
         {
115
-            const TQString helpNotFound = "khelpcenter/helpnotfound/index.html";
116
-            if (!langLookup(helpNotFound).isEmpty())
109
+            const TQString helpNotFound("khelpcenter/helpnotfound/index.html");
110
+            result = langLookup(helpNotFound);
111
+            if (!result.isEmpty())
117 112
             {
118
-                KURL red;
119
-                red.setProtocol("help");
113
+                KURL red("help:/");
120 114
                 red.setPath(helpNotFound);
121 115
                 red.setQuery(query);
122 116
                 redirection(red);
@@ -125,7 +119,7 @@ TQString HelpProtocol::lookupFile(const TQString &fname,
125 119
             }
126 120
             else
127 121
             {
128
-                unicodeError( i18n("There is no documentation available for %1." ).arg(path) );
122
+                unicodeError(i18n("Sorry, there is no documentation available at all for %1." ).arg(fname));
129 123
                 finished();
130 124
                 return TQString::null;
131 125
             }

Loading…
Cancel
Save