KDE/kdevelop/documentation/qthelp

Andreas Pakulat apaku at gmx.de
Sat Apr 18 06:50:37 UTC 2009


On 18.04.09 01:27:02, Aleix Pol Gonzalez wrote:
> SVN commit 955589 by apol:
> 
> Let the plugin to load all the .qch files in the found documentation directory.

I agree with Thomas (in the bugreport related to this), that if Qt
Assistant allows to add arbitrary dirs/files to its list of docs, we
should either read that information as well, or provide our own config
to setup these paths. I think we should have both - so people don't have
to start Qt Assistant to add some .qch to kdevelop - so we read and
write the same config entry as Qt Assistant and also provide a GUI to
add additional dirs/files.

Config for Qt Assistant is in $HOME/.config/Trolltech/ I guess (though
if you use QSettings with "Trolltech" you don't need to care.

What do you think?

Andreas
 
> 
>  M  +22 -16    qthelpplugin.cpp  
> 
> 
> --- trunk/KDE/kdevelop/documentation/qthelp/qthelpplugin.cpp #955588:955589
> @@ -213,35 +213,41 @@
>  	return ret;
>  }
>  
> +
> +
>  QtHelpPlugin::QtHelpPlugin(QObject* parent, const QVariantList& args)
>  	: KDevelop::IPlugin(QtHelpFactory::componentData(), parent)
>  	, m_engine(KStandardDirs::locateLocal("data", "qthelpcollection", QtHelpFactory::componentData()))
>  {
>  	QStringList qmakes;
>      KStandardDirs::findAllExe(qmakes, "qmake");
> -	QString fileName;
> +	QString dirName;
>      foreach(const QString& qmake, qmakes) {
> -        fileName=qtDocsLocation(qmake)+"/qch/qt.qch";
> +        dirName=qtDocsLocation(qmake)+qtDocsLocation(qmake)+"/qch/";
> +        QString fileName=dirName+"qt.qch";
>          if(QFile::exists(fileName)) {
>              kDebug() << "checking doc: " << fileName;
>              break;
> +        } else
> +            dirName.clear();
> +    }
> +    
> +    QDir d(dirName);
> +	foreach(const QString& fileName, d.entryList()) {
> +        bool b=m_engine.setupData();
> +        kDebug() << "setup" << b << m_engine.error();
> +        
> +        QString fileNamespace = QHelpEngineCore::namespaceName(fileName);
> +        
> +        if (!fileNamespace.isEmpty() && !m_engine.registeredDocumentations().contains(fileNamespace)) {
> +            kDebug() << "loading doc" << fileName << fileNamespace;
> +            if(m_engine.registerDocumentation(fileName))
> +                kDebug() << "documentation added successfully" << fileName;
> +            else
> +                kDebug() << "error >> " << fileName << m_engine.error();
>          }
>      }
> -    
>  	bool b=m_engine.setupData();
> -	kDebug() << "setup" << b << m_engine.error();
> -	
> -	QString fileNamespace = QHelpEngineCore::namespaceName(fileName);
> -	
> -	if (!fileNamespace.isEmpty() && !m_engine.registeredDocumentations().contains(fileNamespace)) {
> -		kDebug() << "loading doc" << fileName << fileNamespace;
> -		if(m_engine.registerDocumentation(fileName))
> -			kDebug() << "documentation added successfully" << fileName;
> -		else
> -			kDebug() << "error >> " << fileName << m_engine.error();
> -	}
> -	
> -	b=m_engine.setupData();
>  	kDebug() << "registered" << b << m_engine.error() << m_engine.registeredDocumentations();
>  }
>  
> 

-- 
Are you ever going to do the dishes?  Or will you change your major to biology?




More information about the KDevelop-devel mailing list