fix disappearing contacts #197
This commit is contained in:
@@ -565,27 +565,17 @@ try {
|
|||||||
|
|
||||||
QString AddressBook::writeableFile()
|
QString AddressBook::writeableFile()
|
||||||
{
|
{
|
||||||
auto filename = QStringLiteral("addresslabels.dat");
|
auto filename = QStringLiteral("addresslabels.dat");
|
||||||
auto dir = QDir(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation));
|
|
||||||
|
|
||||||
try {
|
auto dir = QDir(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation));
|
||||||
if (!dir.exists())
|
if (!dir.exists())
|
||||||
QDir().mkpath(dir.absolutePath());
|
QDir().mkpath(dir.absolutePath());
|
||||||
|
|
||||||
if (Settings::getInstance()->isTestnet())
|
if (Settings::getInstance()->isTestnet()) {
|
||||||
return dir.filePath("testnet-" % filename);
|
return dir.filePath("testnet-" % filename);
|
||||||
|
} else {
|
||||||
else
|
|
||||||
return dir.filePath(filename);
|
return dir.filePath(filename);
|
||||||
|
}
|
||||||
} catch(...) {
|
|
||||||
QMessageBox msgWarning;
|
|
||||||
msgWarning.setText("WARNING!\nCould not write Addressbook.");
|
|
||||||
msgWarning.setIcon(QMessageBox::Warning);
|
|
||||||
msgWarning.setWindowTitle("Caution");
|
|
||||||
msgWarning.exec();
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -81,6 +81,11 @@ MainWindow::MainWindow(QWidget *parent) :
|
|||||||
|
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
|
auto dir = QDir(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation));
|
||||||
|
if (!dir.exists()){
|
||||||
|
QDir().mkpath(dir.absolutePath());
|
||||||
|
}else{}
|
||||||
|
|
||||||
logger = new Logger(this, QDir(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation)).filePath("silentdragonlite-wallet.log"));
|
logger = new Logger(this, QDir(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation)).filePath("silentdragonlite-wallet.log"));
|
||||||
// Check for encryption
|
// Check for encryption
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user