Skip to content
Extraits de code Groupes Projets
Valider 355ad911 rédigé par Amar Takhar's avatar Amar Takhar
Parcourir les fichiers

* Instead of ~ use getenv("HOME") to get the users home directory.

 * Fix Locale() to return P_LOCALE
 * Change data and doc values to P_DATA and P_DOC.

Originally committed to SVN as r5322.
parent 961c1245
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -17,7 +17,7 @@ LDFLAGS += -L../universalchardet -luniversalchardet ...@@ -17,7 +17,7 @@ LDFLAGS += -L../universalchardet -luniversalchardet
endif endif
common/charset_conv.o: CXXFLAGS += $(CFLAGS_ICONV) common/charset_conv.o: CXXFLAGS += $(CFLAGS_ICONV)
unix/path.o: CXXFLAGS += -DDIR_DATA=\"$(P_DATA)\" -DDIR_DOC=\"$(P_DOC)\" unix/path.o: CXXFLAGS += -DP_DATA=\"$(P_DATA)\" -DP_DOC=\"$(P_DOC)\" -DP_LOCALE=\"$(P_LOCALE)\"
SRC = \ SRC = \
common/charset.cpp \ common/charset.cpp \
......
...@@ -22,6 +22,9 @@ ...@@ -22,6 +22,9 @@
#include "config.h" #include "config.h"
#ifndef LAGI_PRE #ifndef LAGI_PRE
#include <stdio.h>
#include <stdlib.h>
#include <string> #include <string>
#endif #endif
...@@ -30,26 +33,40 @@ ...@@ -30,26 +33,40 @@
namespace agi { namespace agi {
const std::string home() {
char *ehome;
ehome = getenv("HOME");
if (ehome == NULL) {
//XXX: explode here.
}
std::string home(ehome);
free(ehome);
return home;
}
const std::string Path::Data() { const std::string Path::Data() {
return DIR_DATA; return P_DATA;
} }
const std::string Path::Doc() { const std::string Path::Doc() {
return DIR_DOC; return P_DOC;
} }
const std::string Path::User() { const std::string Path::User() {
return "~/"; return home();
} }
const std::string Path::Locale() { const std::string Path::Locale() {
std::string tmp("~/.aegisub-"); return P_LOCALE;
return tmp.append(AEGISUB_VERSION_DATA);
} }
const std::string Path::Config() { const std::string Path::Config() {
std::string tmp("~/.aegisub-"); std::string tmp(home());
return tmp.append(AEGISUB_VERSION_DATA); tmp.append("/.aegisub-");
tmp.append(AEGISUB_VERSION_DATA);
return tmp.append("/");
} }
const std::string Path::Temp() { const std::string Path::Temp() {
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter