Skip to content
Snippets Groups Projects
Commit 0c9b7860 authored by Jan Möbius's avatar Jan Möbius
Browse files

Be more verbose on errors when loading ini files

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@7520 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 68bfce67
No related branches found
No related tags found
No related merge requests found
......@@ -728,8 +728,24 @@ void Core::openIniFile( QString _filename,
QString sectionName = openFiles[i];
// Check if the string read is empty (e.g. colon at the end of the line ...)
// So skip trying to read files without a filename.
if ( sectionName.isEmpty() ) {
emit log(LOGWARN,tr("Warning from ini file parser: OpenFiles list contains empty string.") );
continue;
}
// Check if the specified section exists
if ( !ini.section_exists(sectionName) ) {
emit log(LOGERR,tr("Error parsing ini file. OpenFiles section %1 not found in File!").arg(sectionName));
continue;
}
QString path;
ini.get_entry( path, sectionName , "path" );
if ( !ini.get_entry( path, sectionName , "path" ) ) {
emit log(LOGERR,tr("Error parsing ini file. Section %1 contains no path description!").arg(sectionName));
continue;
}
//check if path is relative
if (path.startsWith( "." + OpenFlipper::Options::dirSeparator() )){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment