mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-20 06:45:27 +00:00
qthelper.cpp: remove system_default_directory()
This function is now exposed in the <os>.c API. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
e8a868aae2
commit
105cf3a01b
1 changed files with 0 additions and 24 deletions
24
qthelper.cpp
24
qthelper.cpp
|
@ -603,30 +603,6 @@ extern "C" timestamp_t picture_get_timestamp(char *filename)
|
||||||
return exif.epoch();
|
return exif.epoch();
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" const char *system_default_directory(void)
|
|
||||||
{
|
|
||||||
static char filename[PATH_MAX];
|
|
||||||
|
|
||||||
if (!*filename) {
|
|
||||||
enum QStandardPaths::StandardLocation location;
|
|
||||||
|
|
||||||
// allegedly once you're on Qt5.4 or later you should use
|
|
||||||
// QStandardPaths::AppDataLocation but on Mac that gives us
|
|
||||||
// paths starting with /Library/...
|
|
||||||
// #if QT_VERSION >= 0x050400
|
|
||||||
// location = QStandardPaths::AppDataLocation;
|
|
||||||
// #else
|
|
||||||
location = QStandardPaths::DataLocation;
|
|
||||||
// #endif
|
|
||||||
QString name = QStandardPaths::standardLocations(location).first();
|
|
||||||
QDir dir(name);
|
|
||||||
dir.mkpath(name);
|
|
||||||
// Why no "dir.encodeName()"? Crazy Qt
|
|
||||||
strncpy(filename, QFile::encodeName(name), PATH_MAX-1);
|
|
||||||
}
|
|
||||||
return filename;
|
|
||||||
}
|
|
||||||
|
|
||||||
extern "C" char *move_away(const char *old_path)
|
extern "C" char *move_away(const char *old_path)
|
||||||
{
|
{
|
||||||
if (verbose > 1)
|
if (verbose > 1)
|
||||||
|
|
Loading…
Add table
Reference in a new issue