changeset 318:e9fe3923bdf4

* RemoteFile -> FileSource now it's used all over the place for local files as well.
author Chris Cannam
date Thu, 18 Oct 2007 16:20:26 +0000
parents e251c3599ea8
children 2a50c1ecc990
files layer/ImageLayer.cpp layer/ImageLayer.h widgets/ImageDialog.cpp widgets/ImageDialog.h
diffstat 4 files changed, 15 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/layer/ImageLayer.cpp	Thu Oct 18 15:31:20 2007 +0000
+++ b/layer/ImageLayer.cpp	Thu Oct 18 16:20:26 2007 +0000
@@ -21,7 +21,7 @@
 #include "view/View.h"
 
 #include "data/model/ImageModel.h"
-#include "data/fileio/RemoteFile.h"
+#include "data/fileio/FileSource.h"
 
 #include "widgets/ImageDialog.h"
 
@@ -52,7 +52,7 @@
 
 ImageLayer::~ImageLayer()
 {
-    for (RemoteFileMap::iterator i = m_remoteFiles.begin();
+    for (FileSourceMap::iterator i = m_remoteFiles.begin();
          i != m_remoteFiles.end(); ++i) {
         delete i->second;
     }
@@ -884,7 +884,7 @@
 void
 ImageLayer::checkAddRemote(QString img) const
 {
-    if (RemoteFile::isRemote(img)) {
+    if (FileSource::isRemote(img)) {
 
         std::cerr << "ImageLayer::checkAddRemote(" << img.toStdString() << "): yes, trying..." << std::endl;
 
@@ -892,7 +892,7 @@
             return;
         }
 
-        RemoteFile *rf = new RemoteFile(img);
+        FileSource *rf = new FileSource(img);
         if (rf->isOK()) {
             std::cerr << "ok, adding it (local filename = " << rf->getLocalFilename().toStdString() << ")" << std::endl;
             m_remoteFiles[img] = rf;
@@ -920,11 +920,11 @@
 {
 //    std::cerr << "ImageLayer::remoteFileReady" << std::endl;
 
-    RemoteFile *rf = dynamic_cast<RemoteFile *>(sender());
+    FileSource *rf = dynamic_cast<FileSource *>(sender());
     if (!rf) return;
 
     QString img;
-    for (RemoteFileMap::const_iterator i = m_remoteFiles.begin();
+    for (FileSourceMap::const_iterator i = m_remoteFiles.begin();
          i != m_remoteFiles.end(); ++i) {
         if (i->second == rf) {
             img = i->first;
--- a/layer/ImageLayer.h	Thu Oct 18 15:31:20 2007 +0000
+++ b/layer/ImageLayer.h	Thu Oct 18 16:20:26 2007 +0000
@@ -28,7 +28,7 @@
 
 class View;
 class QPainter;
-class RemoteFile;
+class FileSource;
 
 class ImageLayer : public Layer
 {
@@ -115,12 +115,12 @@
 
     typedef std::map<QString, QImage> ImageMap;
     typedef std::map<const View *, ImageMap> ViewImageMap;
-    typedef std::map<QString, RemoteFile *> RemoteFileMap;
+    typedef std::map<QString, FileSource *> FileSourceMap;
 
     static ImageMap m_images;
     static QMutex m_imageMapMutex;
     mutable ViewImageMap m_scaled;
-    mutable RemoteFileMap m_remoteFiles;
+    mutable FileSourceMap m_remoteFiles;
 
     QString getLocalFilename(QString img) const;
     void checkAddRemote(QString img) const;
--- a/widgets/ImageDialog.cpp	Thu Oct 18 15:31:20 2007 +0000
+++ b/widgets/ImageDialog.cpp	Thu Oct 18 16:20:26 2007 +0000
@@ -26,7 +26,7 @@
 #include <QUrl>
 #include <QMessageBox>
 
-#include "data/fileio/RemoteFile.h"
+#include "data/fileio/FileSource.h"
 #include "data/fileio/FileFinder.h"
 
 #include <iostream>
@@ -179,14 +179,14 @@
         delete m_remoteFile;
         m_remoteFile = 0;
 
-        if (RemoteFile::isRemote(fileName)) {
+        if (FileSource::isRemote(fileName)) {
             QUrl url(fileName);
-            if (!RemoteFile::canHandleScheme(url)) {
+            if (!FileSource::canHandleScheme(url)) {
                 QMessageBox::critical(this, tr("Unsupported scheme in URL"),
                                       tr("The URL scheme \"%1\" is not supported")
                                       .arg(url.scheme()));
             } else {
-                m_remoteFile = new RemoteFile(url);
+                m_remoteFile = new FileSource(url);
                 m_remoteFile->waitForData();
                 if (!m_remoteFile->isOK()) {
                     QMessageBox::critical(this, tr("File download failed"),
--- a/widgets/ImageDialog.h	Thu Oct 18 15:31:20 2007 +0000
+++ b/widgets/ImageDialog.h	Thu Oct 18 16:20:26 2007 +0000
@@ -22,7 +22,7 @@
 class QLineEdit;
 class QLabel;
 class QPushButton;
-class RemoteFile;
+class FileSource;
 
 class ImageDialog : public QDialog
 {
@@ -65,7 +65,7 @@
 
     QPushButton *m_okButton;
 
-    RemoteFile *m_remoteFile;
+    FileSource *m_remoteFile;
 };
 
 #endif