Browse Source

Added support for handbookDocPath(). This relates to bug 1850.

Michele Calgaro 4 years ago
parent
commit
01d88b2886

+ 5
- 0
tdeui/tdecmodule.cpp View File

@@ -208,6 +208,11 @@ TQString TDECModule::quickHelp() const
208 208
     return d->_quickHelp;
209 209
 }
210 210
 
211
+TQString TDECModule::handbookDocPath() const
212
+{
213
+    return TQString::null;
214
+}
215
+
211 216
 TQString TDECModule::handbookSection() const
212 217
 {
213 218
     return TQString::null;

+ 10
- 0
tdeui/tdecmodule.h View File

@@ -178,6 +178,16 @@ public:
178 178
   virtual TQString quickHelp() const;
179 179
 
180 180
   /**
181
+   * If the handbook's docPath string of the currently displayed content
182
+   * (for example in tabbed control center modules) differs from the docPath string
183
+   * of the currently displaying container, this method returns the relevant docPath string
184
+   *
185
+   * @returns a TQString containing the relevant handbook's docPath string or TQString::null 
186
+   *          if no specific docPath string is required (i.e. the container docPath is sufficient)
187
+   */
188
+  virtual TQString handbookDocPath() const;
189
+  
190
+  /**
181 191
    * If a specific handbook section is relevant to the currently displayed content
182 192
    * (for example tabbed control center modules) this method returns the relevant section name
183 193
    *

+ 7
- 3
tdeutils/kcmultidialog.cpp View File

@@ -189,10 +189,14 @@ void KCMultiDialog::slotHelp()
189 189
     for( ModuleList::Iterator it = m_modules.begin(); it != end; ++it ) {
190 190
         if( pageIndex( ( TQWidget * )( *it ).kcm->parent() ) == curPageIndex )
191 191
         {
192
-            docPath = ( *it ).kcm->moduleInfo().docPath();
193
-            TDECModuleProxy * m = ( *it ).kcm;
192
+            TDECModuleProxy *m = (*it).kcm;
193
+            
194
+            docPath = m->handbookDocPath();
195
+            if (docPath == TQString::null)
196
+              docPath = m->moduleInfo().docPath();
197
+                        
194 198
             TQString section = m->handbookSection();
195
-            if (section != "") {
199
+            if (section != TQString::null) {
196 200
                 docPath = TQString( "%1#%2" ).arg( docPath ).arg( section );
197 201
             }
198 202
             break;

+ 12
- 0
tdeutils/tdecmoduleproxy.cpp View File

@@ -598,6 +598,18 @@ const TDEAboutData * TDECModuleProxy::aboutData() const
598 598
 	}
599 599
 }
600 600
 
601
+TQString TDECModuleProxy::handbookDocPath() const
602
+{
603
+	if( !d->rootMode ) {
604
+		return realModule() ? realModule()->handbookDocPath() : TQString::null;
605
+	}
606
+	else {
607
+	/* This needs fixing, perhaps cache a handbookSection() copy
608
+	 * while in root mode? */
609
+		return TQString::null;
610
+	}
611
+}
612
+
601 613
 TQString TDECModuleProxy::handbookSection() const
602 614
 {
603 615
 	if( !d->rootMode ) {

+ 5
- 0
tdeutils/tdecmoduleproxy.h View File

@@ -158,6 +158,11 @@ public:
158 158
 	const TDEAboutData * aboutData() const;
159 159
 
160 160
 	/**
161
+	 * @return the module's handbookDocPath()
162
+	 */
163
+	TQString handbookDocPath() const;
164
+
165
+	/**
161 166
 	 * @return the module's handbookSection()
162 167
 	 */
163 168
 	TQString handbookSection() const;

Loading…
Cancel
Save