diff options
author | Michele Calgaro <michele.calgaro@yahoo.it> | 2014-11-27 11:51:59 +0900 |
---|---|---|
committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2014-11-27 11:51:59 +0900 |
commit | 01d88b2886ada398c883a44410827b11b907e512 (patch) | |
tree | a293fc2e5c18385408a922ea6544052b9b9bb103 | |
parent | d4b2ca0550eeacd278c638664b43464239342244 (diff) | |
download | tdelibs-01d88b2886ada398c883a44410827b11b907e512.tar.gz tdelibs-01d88b2886ada398c883a44410827b11b907e512.zip |
Added support for handbookDocPath(). This relates to bug 1850.
-rw-r--r-- | tdeui/tdecmodule.cpp | 5 | ||||
-rw-r--r-- | tdeui/tdecmodule.h | 10 | ||||
-rw-r--r-- | tdeutils/kcmultidialog.cpp | 10 | ||||
-rw-r--r-- | tdeutils/tdecmoduleproxy.cpp | 12 | ||||
-rw-r--r-- | tdeutils/tdecmoduleproxy.h | 5 |
5 files changed, 39 insertions, 3 deletions
diff --git a/tdeui/tdecmodule.cpp b/tdeui/tdecmodule.cpp index 1c718273a..48a72b6b3 100644 --- a/tdeui/tdecmodule.cpp +++ b/tdeui/tdecmodule.cpp @@ -208,6 +208,11 @@ TQString TDECModule::quickHelp() const return d->_quickHelp; } +TQString TDECModule::handbookDocPath() const +{ + return TQString::null; +} + TQString TDECModule::handbookSection() const { return TQString::null; diff --git a/tdeui/tdecmodule.h b/tdeui/tdecmodule.h index b4d7f6d88..186ee6656 100644 --- a/tdeui/tdecmodule.h +++ b/tdeui/tdecmodule.h @@ -178,6 +178,16 @@ public: virtual TQString quickHelp() const; /** + * If the handbook's docPath string of the currently displayed content + * (for example in tabbed control center modules) differs from the docPath string + * of the currently displaying container, this method returns the relevant docPath string + * + * @returns a TQString containing the relevant handbook's docPath string or TQString::null + * if no specific docPath string is required (i.e. the container docPath is sufficient) + */ + virtual TQString handbookDocPath() const; + + /** * If a specific handbook section is relevant to the currently displayed content * (for example tabbed control center modules) this method returns the relevant section name * diff --git a/tdeutils/kcmultidialog.cpp b/tdeutils/kcmultidialog.cpp index 0ba07fe6b..cbdffaa7d 100644 --- a/tdeutils/kcmultidialog.cpp +++ b/tdeutils/kcmultidialog.cpp @@ -189,10 +189,14 @@ void KCMultiDialog::slotHelp() for( ModuleList::Iterator it = m_modules.begin(); it != end; ++it ) { if( pageIndex( ( TQWidget * )( *it ).kcm->parent() ) == curPageIndex ) { - docPath = ( *it ).kcm->moduleInfo().docPath(); - TDECModuleProxy * m = ( *it ).kcm; + TDECModuleProxy *m = (*it).kcm; + + docPath = m->handbookDocPath(); + if (docPath == TQString::null) + docPath = m->moduleInfo().docPath(); + TQString section = m->handbookSection(); - if (section != "") { + if (section != TQString::null) { docPath = TQString( "%1#%2" ).arg( docPath ).arg( section ); } break; diff --git a/tdeutils/tdecmoduleproxy.cpp b/tdeutils/tdecmoduleproxy.cpp index 75da38e02..d074b8c02 100644 --- a/tdeutils/tdecmoduleproxy.cpp +++ b/tdeutils/tdecmoduleproxy.cpp @@ -598,6 +598,18 @@ const TDEAboutData * TDECModuleProxy::aboutData() const } } +TQString TDECModuleProxy::handbookDocPath() const +{ + if( !d->rootMode ) { + return realModule() ? realModule()->handbookDocPath() : TQString::null; + } + else { + /* This needs fixing, perhaps cache a handbookSection() copy + * while in root mode? */ + return TQString::null; + } +} + TQString TDECModuleProxy::handbookSection() const { if( !d->rootMode ) { diff --git a/tdeutils/tdecmoduleproxy.h b/tdeutils/tdecmoduleproxy.h index 3d2b1ca82..f5b570125 100644 --- a/tdeutils/tdecmoduleproxy.h +++ b/tdeutils/tdecmoduleproxy.h @@ -158,6 +158,11 @@ public: const TDEAboutData * aboutData() const; /** + * @return the module's handbookDocPath() + */ + TQString handbookDocPath() const; + + /** * @return the module's handbookSection() */ TQString handbookSection() const; |