Skip to content

Commit

Permalink
Remove the now unused function loadFiles.
Browse files Browse the repository at this point in the history
  • Loading branch information
Krakonos committed Jun 6, 2016
1 parent 3e4a728 commit 836454b
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 96 deletions.
95 changes: 0 additions & 95 deletions src/MainWindow.cpp
Expand Up @@ -1793,101 +1793,6 @@ bool MainWindow::importFiles(Document * mapDocument, const QStringList & fileNam
return foundImport;
}

void MainWindow::loadFiles(const QStringList & fileList)
{
QStringList fileNames(fileList);

#ifdef GEOIMAGE
QStringList images = fileList.filter(".jpg", Qt::CaseInsensitive);
if (!images.isEmpty()) {
theGeoImage->loadImages(images);
QString cur;
foreach (cur, images)
fileNames.removeAll(cur);
}
#endif

if (fileNames.isEmpty())
return;
theLayers->setUpdatesEnabled(false);
view()->setUpdatesEnabled(false);

// Load only the first merkaartor document
bool skipImport = false;
QMutableStringListIterator it(fileNames);
while (it.hasNext())
{
const QString & fn = it.next();

if (fn.toLower().endsWith(".mdc") == false)
continue;

if (skipImport == false)
{
loadDocument(fn);
skipImport = true;
}

it.remove();
}

Document* newDoc = theDocument;
if (skipImport == false) {
newDoc = new Document(theLayers);
newDoc->addDefaultLayers();
}

QStringList openedFiles;
bool foundImport = importFiles(newDoc, fileNames, &openedFiles);

foreach (QString currentFileName, openedFiles)
M_PREFS->addRecentOpen(currentFileName);

updateRecentOpenMenu();

p->theProperties->setSelection(0);

if (skipImport == false)
{
if (foundImport)
{
// only imported some tracks
p->theFeats->invalidate();
delete theDocument;
theDocument = newDoc;
connect (theDocument, SIGNAL(historyChanged()), theDirty, SLOT(updateList()));
connect (theDocument, SIGNAL(historyChanged()), this, SIGNAL(content_changed()));
connect(theDocument, SIGNAL(imageRequested(ImageMapLayer*)),
this, SLOT(onImagerequested(ImageMapLayer*)), Qt::QueuedConnection);
connect(theDocument, SIGNAL(imageReceived(ImageMapLayer*)),
this, SLOT(onImagereceived(ImageMapLayer*)), Qt::QueuedConnection);
connect(theDocument, SIGNAL(loadingFinished(ImageMapLayer*)),
this, SLOT(onLoadingfinished(ImageMapLayer*)), Qt::QueuedConnection);

theDirty->updateList();
theView->setDocument(theDocument);
on_viewZoomAllAction_triggered();
}
else
{
// we didn't really open anything successfully
delete newDoc;
}
} else {
if (foundImport) {
on_viewZoomAllAction_triggered();
}
}

on_editPropertiesAction_triggered();
theDocument->history().setActions(ui->editUndoAction, ui->editRedoAction, ui->fileUploadAction);

theLayers->setUpdatesEnabled(true);
view()->setUpdatesEnabled(true);

invalidateView(false);
}

void MainWindow::loadUrl(const QUrl& theUrl)
{
activateWindow();
Expand Down
1 change: 0 additions & 1 deletion src/MainWindow.h
Expand Up @@ -257,7 +257,6 @@ public slots:

public:
bool importFiles(Document * mapDocument, const QStringList & filesNames, QStringList * importedFileNames = NULL);
void loadFiles(const QStringList & fileNames);
void loadUrl(const QUrl& u);
void loadDocument(QString fn);
void loadTemplateDocument(QString fn);
Expand Down

0 comments on commit 836454b

Please sign in to comment.