mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-27 20:58:47 +00:00
This patch reverts commit 50421f1f
.
Expose subsurface_mkdir() in qthelper.h as main.cpp already includes it. Once 'default_directory' is obtained call subsurface_mkdir() on it. subsurface_mkdir() will not throw an error if the directory exists according to the QDir documentation. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
7b51a4c1be
commit
8d2d7cd4a3
4 changed files with 2 additions and 5 deletions
3
linux.c
3
linux.c
|
@ -3,7 +3,6 @@
|
|||
#include "dive.h"
|
||||
#include "display.h"
|
||||
#include "membuffer.h"
|
||||
#include "qthelperfromc.h"
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
#include <dirent.h>
|
||||
|
@ -64,8 +63,6 @@ static const char *system_default_path_append(const char *append)
|
|||
memset(buffer, 0, len);
|
||||
strcat(buffer, home);
|
||||
strcat(buffer, path);
|
||||
// make sure this path exists
|
||||
subsurface_mkdir(buffer);
|
||||
if (append) {
|
||||
strcat(buffer, "/");
|
||||
strcat(buffer, append);
|
||||
|
|
2
macos.c
2
macos.c
|
@ -56,8 +56,6 @@ static const char *system_default_path_append(const char *append)
|
|||
memset(buffer, 0, len);
|
||||
strcat(buffer, home);
|
||||
strcat(buffer, path);
|
||||
// make sure this path exists
|
||||
subsurface_mkdir(buffer);
|
||||
if (append) {
|
||||
strcat(buffer, "/");
|
||||
strcat(buffer, append);
|
||||
|
|
1
main.cpp
1
main.cpp
|
@ -36,6 +36,7 @@ int main(int argc, char **argv)
|
|||
|
||||
const char *default_directory = system_default_directory();
|
||||
const char *default_filename = system_default_filename();
|
||||
subsurface_mkdir(default_directory);
|
||||
|
||||
for (i = 1; i < arguments.length(); i++) {
|
||||
QString a = arguments.at(i);
|
||||
|
|
|
@ -130,5 +130,6 @@ bool parseGpsText(const QString &gps_text, double *latitude, double *longitude);
|
|||
QByteArray getCurrentAppState();
|
||||
void setCurrentAppState(QByteArray state);
|
||||
extern "C" bool in_planner();
|
||||
extern "C" void subsurface_mkdir(const char *dir);
|
||||
|
||||
#endif // QTHELPER_H
|
||||
|
|
Loading…
Reference in a new issue