@KjellM (or anyone else
)
In
src/utils/folderutils.cpp
current code:
QString FolderUtils::getTopLevelUserDataStorePath() {
QString path = QSettings(QSettings::IniFormat,QSettings::UserScope,“Fritzing”,“Fritzing”).fileName();
return QFileInfo(path).dir().absolutePath();
}
QString FolderUtils::getTopLevelDocumentsPath() {
// must add a fritzing subfolder
QDir dir(QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation));
return dir.absoluteFilePath(“Fritzing”);
}
desired code:
QString FolderUtils::getTopLevelUserDataStorePath() {
QString path = QSettings(QSettings::IniFormat,QSettings::UserScope,m_userFolderPrefix,m_userFolderPrefix).fileName();
return QFileInfo(path).dir().absolutePath();
}
QString FolderUtils::getTopLevelDocumentsPath() {
// must add a fritzing subfolder
QDir dir(QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation));
return dir.absoluteFilePath(m_userFolderPrefix);
}
where m_userFolderPrefix is a new protected static variable defined like this in
src/utils/folderutils.h
protected:
static FolderUtils* singleton;
static QString m_openSaveFolder;
static QString m_userFolderPrefix;
which I think should give me a static private variable that can be set to the string “Fritzing” (not done yet!) to specify the user directories (with the intent of later being able to modify the value to change the path to the user directories.) This gets an error
debug/folderutils.o at line 141 in folderutils.cpp undefined reference to FolderUtils::m_userFolderPrefix (where line 141 is the first “Fritzing” I replaced with m_userFolderPrefix)
when compiled, even though m_openSaveFolder defined just above m_userFolderPrefix in the .h file is used in public function FolderUtils::openSaveFolder() and seems to resolve correctly (and thus I think should work here!) Can you tell me what I am doing wrong please?
Peter
1 post - 1 participant
Read full topic