From: Jeremy Paul Whiting Date: Mon, 25 Jun 2007 19:25:35 +0000 (+0000) Subject: made SharedKvtmlFiles into a namespace so you can call SharedKvtmlFiles::languages... X-Git-Tag: v3.91.0~3 X-Git-Url: https://git.rmz.fi/?a=commitdiff_plain;h=2a333acb97334076328c2357bc8a14462044f9bb;p=libqmvoc.git made SharedKvtmlFiles into a namespace so you can call SharedKvtmlFiles::languages() instead of SharedKvtmlFiles::self()->languages(), and removed the self call svn path=/trunk/KDE/kdeedu/libkdeedu/; revision=680263 --- diff --git a/kdeeducore/sharedkvtmlfiles.cpp b/kdeeducore/sharedkvtmlfiles.cpp index 5bbef40..5954736 100644 --- a/kdeeducore/sharedkvtmlfiles.cpp +++ b/kdeeducore/sharedkvtmlfiles.cpp @@ -38,8 +38,6 @@ class SharedKvtmlFilesPrivate { } - SharedKvtmlFiles instance; - /** scan the folder for documents, and record what is found */ void rescan(); @@ -58,20 +56,6 @@ class SharedKvtmlFilesPrivate K_GLOBAL_STATIC(SharedKvtmlFilesPrivate, sharedKvtmlFilesPrivate) -SharedKvtmlFiles *SharedKvtmlFiles::self() -{ - // returns the singleton; automatically creates a new instance if that has not happened yet. - return &sharedKvtmlFilesPrivate->instance; -} - -SharedKvtmlFiles::SharedKvtmlFiles() -{ -} - -SharedKvtmlFiles::~SharedKvtmlFiles() -{ -} - void SharedKvtmlFilesPrivate::rescan() { this->m_titleList.clear(); diff --git a/kdeeducore/sharedkvtmlfiles.h b/kdeeducore/sharedkvtmlfiles.h index 50fbfed..02f14cc 100644 --- a/kdeeducore/sharedkvtmlfiles.h +++ b/kdeeducore/sharedkvtmlfiles.h @@ -35,43 +35,32 @@ class SharedKvtmlFilesPrivate; *about files found there *@author Jeremy Whiting */ -class KDEEDUCORE_EXPORT SharedKvtmlFiles +namespace SharedKvtmlFiles { - friend class SharedKvtmlFilesPrivate; - public: - /** singleton accessor */ - static SharedKvtmlFiles *self(); - /** get list of all languages found in any files */ - QStringList languages(); - - /** get list of filenames found of given language - *@param language language requested QString() for all languages - *@return a list of filenames with words in language - */ - QStringList fileNames(const QString &language = QString()); + KDEEDUCORE_EXPORT QStringList languages(); + + /** get list of filenames found of given language + *@param language language requested QString() for all languages + *@return a list of filenames with words in language + */ + KDEEDUCORE_EXPORT QStringList fileNames(const QString &language = QString()); /** get the list of document titles found of a given language - *@param language requested language QString() for all titles - *@return a list of document titles with words in language - */ - QStringList titles(const QString &language = QString()); - - /** get the list of document remarts found of a given language - *@param language requested language QString() for all comments - *@return a list of document remarks with words in language - */ - QStringList comments(const QString &language = QString()); + *@param language requested language QString() for all titles + *@return a list of document titles with words in language + */ + KDEEDUCORE_EXPORT QStringList titles(const QString &language = QString()); + + /** get the list of document remarts found of a given language + *@param language requested language QString() for all comments + *@return a list of document remarks with words in language + */ + KDEEDUCORE_EXPORT QStringList comments(const QString &language = QString()); - /** rescan the shared kvtml locations */ - void rescan(); + /** rescan the shared kvtml locations */ + KDEEDUCORE_EXPORT void rescan(); - private: - /** default contstuctor */ - SharedKvtmlFiles(); - - /** default destructor */ - ~SharedKvtmlFiles(); }; #endif