{
QString masterPassword;
QString appName;
- int passwordLength = DefaultPasswordLength;
+ int passwordLength = 0;
// Process command-line arguments
QStringList args = QCoreApplication::arguments();
QExplicitlySharedDataPointer<PswGen::Storage::Data> data;
if (mStorage) {
data = mStorage->query(appName);
- if (data)
+ if (data && passwordLength == 0)
passwordLength = data->length();
}
+ // If the length argument is still not initialized, use the default length value
+ if (!passwordLength)
+ passwordLength = DefaultPasswordLength;
+
// Generate password
QString password = mGenerator->generatePassword(appName, masterPassword, passwordLength);
cout << "Generated password : " << password << endl;
if (mStorage) {
if (!data)
data = new Storage::Data(appName, passwordLength);
+ else
+ data->setLength(passwordLength);
mStorage->save(appName, data);
}
}
/**
* Module/library version number in the form major,minor,release,build
*/
-#define VER_FILE_VERSION 0,1,1,1
+#define VER_FILE_VERSION 0,1,1,2
/**
* Module/library version number in the string format (shall end with \0)
*/
-#define VER_FILE_VERSION_STR "0.1.1.1\0"
+#define VER_FILE_VERSION_STR "0.1.1.2\0"
/**
* Module/library name (shall end with \0)