*/
}
private void unlockApplication() {
- String fileName = Global.currentDir +"nevernote.lock";
+ // NFC TODO: should this be removed? Looks like H2 now handles the locking, which it will clean up itself. See #lockApplication.
+ String fileName = Global.getFileManager().getHomeDirPath("nevernote.lock");
if (QFile.exists(fileName)) {
QFile.remove(fileName);
}
QTextEdit textBox = new QTextEdit();
layout.addWidget(textBox);
textBox.setReadOnly(true);
- QFile file = new QFile(Global.getDirectoryPath()+"release.txt");
+ QFile file = new QFile(Global.getFileManager().getHomeDirPath("release.txt"));
if (!file.open(new QIODevice.OpenMode(QIODevice.OpenModeFlag.ReadOnly,
QIODevice.OpenModeFlag.Text)))
return;
AESEncrypter aes = new AESEncrypter();
try {
- aes.decrypt(new FileInputStream(Global.getDirectoryPath()+"secure.txt"));
+ aes.decrypt(new FileInputStream(Global.getFileManager().getHomeDirFile("secure.txt")));
} catch (FileNotFoundException e) {
// File not found, so we'll just get empty strings anyway.
}
Global.setTagBehavior(appearancePage.getTagBehavior());\r
FileOutputStream out = null;\r
try {\r
- out = new FileOutputStream(Global.getDirectoryPath()+"secure.txt");\r
+ out = new FileOutputStream(Global.getFileManager().getHomeDirFile("secure.txt"));\r
} catch (FileNotFoundException e) {\r
// if it isn't found we'll write it.\r
}\r
if (Global.username.equalsIgnoreCase("") || Global.password.equalsIgnoreCase("")) {\r
AESEncrypter aes = new AESEncrypter();\r
try {\r
- aes.decrypt(new FileInputStream(Global.getDirectoryPath()+"secure.txt"));\r
+ aes.decrypt(new FileInputStream(Global.getFileManager().getHomeDirFile("secure.txt")));\r
} catch (FileNotFoundException e) {\r
// File not found, so we'll just get empty strings anyway. \r
}\r
\r
// Read in the custom keys (if they exist)\r
private void loadCustomKeys() {\r
- File file = new File(Global.getDirectoryPath()+"shortcuts.txt");\r
+ File file = Global.getFileManager().getHomeDirFile("shortcuts.txt");\r
try {\r
Scanner scanner = new Scanner(file);\r
while ( scanner.hasNextLine() ){\r