Commit 9a75d4dd authored by Stefan Brüns's avatar Stefan Brüns
Browse files

Export FileManager class, emit a signal when a file fails to load

The FileManager class is accesible from the public
`MarbleModel::fileManager()` method.

The `fileError` signal is useful to wait for a file to have loaded, it
is the error counterpart of the `fileAdded` signal.
parent f52d6e6e
......@@ -192,7 +192,8 @@ void FileManagerPrivate::cleanupLoader( FileLoader* loader )
errorBox.setText( loader->error() );
errorBox.setIcon( QMessageBox::Warning );
qWarning() << "File Parsing error " << loader->error();
qWarning() << "Failed to parse" << loader->path() << loader->error();
emit q->fileError(loader->path(), loader->error());
delete loader;
......@@ -34,7 +34,7 @@ class PluginManager;
* The loaded data are accessible via
* various models in MarbleModel.
class FileManager : public QObject
class MARBLE_EXPORT FileManager : public QObject
......@@ -81,6 +81,7 @@ class FileManager : public QObject
void fileAdded( const QString &key );
void fileRemoved( const QString &key );
void centeredDocument( const GeoDataLatLonBox& );
void fileError(const QString &key, const QString& error);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment