Commit 1b6d9966 authored by con's avatar con
Browse files

Remove some unused / useless api.

parent 5927137d
......@@ -176,7 +176,7 @@ FileManager::~FileManager()
Returns true if the file specified by \a files have not been yet part of the file list.
*/
bool FileManager::addFiles(const QList<IFile *> &files, bool addWatcher)
void FileManager::addFiles(const QList<IFile *> &files, bool addWatcher)
{
if (!addWatcher) {
// We keep those in a separate list
......@@ -185,10 +185,9 @@ bool FileManager::addFiles(const QList<IFile *> &files, bool addWatcher)
connect(file, SIGNAL(destroyed(QObject *)), this, SLOT(fileDestroyed(QObject *)));
d->m_filesWithoutWatch.append(files);
return true;
return;
}
bool filesAdded = false;
foreach (IFile *file, files) {
if (!file)
continue;
......@@ -197,11 +196,9 @@ bool FileManager::addFiles(const QList<IFile *> &files, bool addWatcher)
continue;
connect(file, SIGNAL(changed()), this, SLOT(checkForNewFileName()));
connect(file, SIGNAL(destroyed(QObject *)), this, SLOT(fileDestroyed(QObject *)));
filesAdded = true;
addFileInfo(file);
}
return filesAdded;
}
void FileManager::addFileInfo(IFile *file)
......@@ -329,9 +326,9 @@ void FileManager::removeFileInfo(const QString &fileName, IFile *file)
Returns true if the file specified by \a file has not been yet part of the file list.
*/
bool FileManager::addFile(IFile *file, bool addWatcher)
void FileManager::addFile(IFile *file, bool addWatcher)
{
return addFiles(QList<IFile *>() << file, addWatcher);
addFiles(QList<IFile *>() << file, addWatcher);
}
void FileManager::fileDestroyed(QObject *obj)
......@@ -353,23 +350,22 @@ void FileManager::fileDestroyed(QObject *obj)
Returns true if the file specified by \a file has been part of the file list.
*/
bool FileManager::removeFile(IFile *file)
void FileManager::removeFile(IFile *file)
{
if (!file)
return false;
return;
// Special casing unwatched files
if (d->m_filesWithoutWatch.contains(file)) {
disconnect(file, SIGNAL(destroyed(QObject *)), this, SLOT(fileDestroyed(QObject *)));
d->m_filesWithoutWatch.removeOne(file);
return true;
return;
}
disconnect(file, SIGNAL(changed()), this, SLOT(checkForNewFileName()));
disconnect(file, SIGNAL(destroyed(QObject *)), this, SLOT(fileDestroyed(QObject *)));
removeFileInfo(file);
return true;
}
void FileManager::checkForNewFileName()
......@@ -412,21 +408,6 @@ QString FileManager::fixFileName(const QString &fileName)
return s;
}
/*!
\fn bool FileManager::isFileManaged(const QString &fileName) const
Returns true if at least one IFile in the set points to \a fileName.
*/
bool FileManager::isFileManaged(const QString &fileName) const
{
if (fileName.isEmpty())
return false;
// TOOD check d->m_filesWithoutWatch
return !d->m_states.contains(fixFileName(fileName));
}
/*!
\fn QList<IFile*> FileManager::modifiedFiles() const
......
......@@ -57,10 +57,9 @@ public:
virtual ~FileManager();
// file pool to monitor
bool addFiles(const QList<IFile *> &files, bool addWatcher = true);
bool addFile(IFile *file, bool addWatcher = true);
bool removeFile(IFile *file);
bool isFileManaged(const QString &fileName) const;
void addFiles(const QList<IFile *> &files, bool addWatcher = true);
void addFile(IFile *file, bool addWatcher = true);
void removeFile(IFile *file);
QList<IFile *> modifiedFiles() const;
void renamedFile(const QString &from, QString &to);
......
......@@ -144,19 +144,19 @@ FileManager *FileManagerPrototype::callee() const
return rc;
}
bool FileManagerPrototype::addFiles(const QList<Core::IFile *> &files)
void FileManagerPrototype::addFiles(const QList<Core::IFile *> &files)
{
return callee()->addFiles(files);
callee()->addFiles(files);
}
bool FileManagerPrototype::addFile(Core::IFile *file)
void FileManagerPrototype::addFile(Core::IFile *file)
{
return callee()->addFile(file);
callee()->addFile(file);
}
bool FileManagerPrototype::removeFile(Core::IFile *file)
void FileManagerPrototype::removeFile(Core::IFile *file)
{
return callee()->removeFile(file);
callee()->removeFile(file);
}
QList<Core::IFile*>
......@@ -170,11 +170,6 @@ QString FileManagerPrototype::getSaveAsFileName(Core::IFile *file)
return callee()->getSaveAsFileName(file);
}
bool FileManagerPrototype::isFileManaged(const QString &fileName) const
{
return callee()->isFileManaged(fileName);
}
void FileManagerPrototype::blockFileChange(Core::IFile *file)
{
callee()->blockFileChange(file);
......
......@@ -107,15 +107,13 @@ public:
QStringList recentFiles() const;
public slots:
bool addFiles(const QList<Core::IFile *> &files);
bool addFile(Core::IFile *file);
bool removeFile(Core::IFile *file);
void addFiles(const QList<Core::IFile *> &files);
void addFile(Core::IFile *file);
void removeFile(Core::IFile *file);
QList<Core::IFile*> saveModifiedFilesSilently(const QList<Core::IFile*> &files);
QString getSaveAsFileName(Core::IFile *file);
bool isFileManaged(const QString &fileName) const;
void blockFileChange(Core::IFile *file);
void unblockFileChange(Core::IFile *file);
......
Markdown is supported
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