forked from mirrors/gio-qt
refactor: rename DGioUtils to DGlibUtils
This commit is contained in:
parent
49b63c6ed5
commit
6da5444c17
4 changed files with 19 additions and 16 deletions
|
@ -4,13 +4,13 @@
|
|||
configure_file ("gio-qt.pc.in" "gio-qt.pc" @ONLY)
|
||||
|
||||
set (QGIO_PUBLIC_HEADER_FILES
|
||||
include/dglibutils.h
|
||||
include/dgiovolumemanager.h
|
||||
include/dgiomountoperation.h
|
||||
include/dgiomount.h
|
||||
include/dgiovolume.h
|
||||
include/dgiofile.h
|
||||
include/dgiofileinfo.h
|
||||
include/dgioutils.h
|
||||
include/dgiofileiterator.h
|
||||
include/dgiodrive.h
|
||||
)
|
||||
|
@ -20,13 +20,13 @@ set (QGIO_PRIVATE_HEADER_FILES
|
|||
)
|
||||
|
||||
set (QGIO_PRIVATE_CPP_FILES
|
||||
source/dglibutils.cpp
|
||||
source/dgiovolumemanager.cpp
|
||||
source/dgiomountoperation.cpp
|
||||
source/dgiomount.cpp
|
||||
source/dgiovolume.cpp
|
||||
source/dgiofile.cpp
|
||||
source/dgiofileinfo.cpp
|
||||
source/dgioutils.cpp
|
||||
source/dgiofileiterator.cpp
|
||||
source/dgiodrive.cpp
|
||||
private/dgiohelper.cpp
|
||||
|
|
|
@ -18,12 +18,12 @@
|
|||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef DGIOUTILS_H
|
||||
#define DGIOUTILS_H
|
||||
#ifndef DGLIBUTILS_H
|
||||
#define DGLIBUTILS_H
|
||||
|
||||
#include <QObject>
|
||||
|
||||
enum DGioUserDirectory
|
||||
enum DGlibUserDirectory
|
||||
{
|
||||
USER_DIRECTORY_DESKTOP,
|
||||
USER_DIRECTORY_DOCUMENTS,
|
||||
|
@ -35,15 +35,15 @@ enum DGioUserDirectory
|
|||
USER_DIRECTORY_VIDEOS,
|
||||
USER_N_DIRECTORIES
|
||||
};
|
||||
Q_ENUMS(DGioUserDirectory);
|
||||
Q_ENUMS(DGlibUserDirectory);
|
||||
|
||||
class DGioUtils
|
||||
class DGlibUtils
|
||||
{
|
||||
public:
|
||||
static QString userSpecialDir(DGioUserDirectory userDirectory);
|
||||
static QString userSpecialDir(DGlibUserDirectory userDirectory);
|
||||
static QStringList systemDataDirs();
|
||||
static QString userDataDir();
|
||||
static QString tmpDir();
|
||||
};
|
||||
|
||||
#endif // DGIOUTILS_H
|
||||
#endif // DGLIBUTILS_H
|
|
@ -18,7 +18,7 @@
|
|||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include "dgioutils.h"
|
||||
#include "dglibutils.h"
|
||||
|
||||
#include <QStringList>
|
||||
|
||||
|
@ -32,8 +32,11 @@
|
|||
*
|
||||
* On UNIX platforms this is determined using the mechanisms described in the
|
||||
* [XDG Base Directory Specification](http://www.freedesktop.org/Standards/basedir-spec).
|
||||
*
|
||||
* \param userDirectory The logical id of special directory.
|
||||
* \return The path to the specified special directory, or an empty string if the logical id was not found.
|
||||
*/
|
||||
QString DGioUtils::userSpecialDir(DGioUserDirectory userDirectory)
|
||||
QString DGlibUtils::userSpecialDir(DGlibUserDirectory userDirectory)
|
||||
{
|
||||
return QString::fromStdString(Glib::get_user_special_dir(static_cast<Glib::UserDirectory>(userDirectory)));
|
||||
}
|
||||
|
@ -48,7 +51,7 @@ QString DGioUtils::userSpecialDir(DGioUserDirectory userDirectory)
|
|||
* [XDG Base Directory Specification](http://www.freedesktop.org/Standards/basedir-spec)
|
||||
* In this case the list of directories retrieved will be XDG_DATA_DIRS.
|
||||
*/
|
||||
QStringList DGioUtils::systemDataDirs()
|
||||
QStringList DGlibUtils::systemDataDirs()
|
||||
{
|
||||
std::vector<std::string> dirs = Glib::get_system_data_dirs();
|
||||
QStringList lst;
|
||||
|
@ -70,7 +73,7 @@ QStringList DGioUtils::systemDataDirs()
|
|||
* [XDG Base Directory Specification](http://www.freedesktop.org/Standards/basedir-spec).
|
||||
* In this case the directory retrieved will be `XDG_DATA_HOME`.
|
||||
*/
|
||||
QString DGioUtils::userDataDir()
|
||||
QString DGlibUtils::userDataDir()
|
||||
{
|
||||
return QString::fromStdString(Glib::get_user_data_dir());
|
||||
}
|
||||
|
@ -86,7 +89,7 @@ QString DGioUtils::userDataDir()
|
|||
*
|
||||
* \return The directory to use for temporary files.
|
||||
*/
|
||||
QString DGioUtils::tmpDir()
|
||||
QString DGlibUtils::tmpDir()
|
||||
{
|
||||
return QString::fromStdString(Glib::get_tmp_dir());
|
||||
}
|
|
@ -22,8 +22,8 @@
|
|||
#include <QCoreApplication>
|
||||
#include <QExplicitlySharedDataPointer>
|
||||
|
||||
#include <dglibutils.h>
|
||||
#include <dgiofile.h>
|
||||
#include <dgioutils.h>
|
||||
#include <dgiomount.h>
|
||||
#include <dgiovolume.h>
|
||||
#include <dgiodrive.h>
|
||||
|
@ -33,7 +33,7 @@
|
|||
|
||||
int main(int argc, char * argv[])
|
||||
{
|
||||
qDebug() << DGioUtils::systemDataDirs();
|
||||
qDebug() << DGlibUtils::systemDataDirs();
|
||||
|
||||
qDebug() << "----------------------";
|
||||
|
||||
|
|
Loading…
Reference in a new issue