From ae55044fe476262f68ef8ffddbad168b55bdfe6b Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Mon, 5 Jun 2017 16:07:37 +0200 Subject: Unused --- .../src/domain/mime/mimetreeparser/CMakeLists.txt | 1 - .../attachmenttemporaryfilesdirs.cpp | 108 --------------------- .../mimetreeparser/attachmenttemporaryfilesdirs.h | 57 ----------- .../src/domain/mime/mimetreeparser/nodehelper.cpp | 1 - .../src/domain/mime/mimetreeparser/nodehelper.h | 8 -- 5 files changed, 175 deletions(-) delete mode 100644 framework/src/domain/mime/mimetreeparser/attachmenttemporaryfilesdirs.cpp delete mode 100644 framework/src/domain/mime/mimetreeparser/attachmenttemporaryfilesdirs.h (limited to 'framework/src/domain/mime/mimetreeparser') diff --git a/framework/src/domain/mime/mimetreeparser/CMakeLists.txt b/framework/src/domain/mime/mimetreeparser/CMakeLists.txt index 1497c30f..a7e7cd9e 100644 --- a/framework/src/domain/mime/mimetreeparser/CMakeLists.txt +++ b/framework/src/domain/mime/mimetreeparser/CMakeLists.txt @@ -51,7 +51,6 @@ set(libmimetreeparser_SRCS mimetreeparser_debug.cpp qgpgmejobexecutor.cpp util.cpp - attachmenttemporaryfilesdirs.cpp ) add_library(kube_otp ${libmimetreeparser_SRCS}) diff --git a/framework/src/domain/mime/mimetreeparser/attachmenttemporaryfilesdirs.cpp b/framework/src/domain/mime/mimetreeparser/attachmenttemporaryfilesdirs.cpp deleted file mode 100644 index 364bc422..00000000 --- a/framework/src/domain/mime/mimetreeparser/attachmenttemporaryfilesdirs.cpp +++ /dev/null @@ -1,108 +0,0 @@ -/* - Copyright (c) 2013-2017 Montel Laurent - - This library is free software; you can redistribute it and/or modify it - under the terms of the GNU Library General Public License as published by - the Free Software Foundation; either version 2 of the License, or (at your - option) any later version. - - This library is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public - License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to the - Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - 02110-1301, USA. - -*/ - -#include "attachmenttemporaryfilesdirs.h" - -#include -#include -#include - -using namespace MimeTreeParser; - -class MimeTreeParser::AttachmentTemporaryFilesDirsPrivate -{ -public: - AttachmentTemporaryFilesDirsPrivate() - : mDelayRemoveAll(10000) - { - - } - QStringList mTempFiles; - QStringList mTempDirs; - int mDelayRemoveAll; -}; - -AttachmentTemporaryFilesDirs::AttachmentTemporaryFilesDirs(QObject *parent) - : QObject(parent), - d(new AttachmentTemporaryFilesDirsPrivate) -{ - -} - -AttachmentTemporaryFilesDirs::~AttachmentTemporaryFilesDirs() -{ - delete d; -} - -void AttachmentTemporaryFilesDirs::setDelayRemoveAllInMs(int ms) -{ - d->mDelayRemoveAll = (ms < 0) ? 0 : ms; -} - -void AttachmentTemporaryFilesDirs::removeTempFiles() -{ - QTimer::singleShot(d->mDelayRemoveAll, this, &AttachmentTemporaryFilesDirs::slotRemoveTempFiles); -} - -void AttachmentTemporaryFilesDirs::forceCleanTempFiles() -{ - QStringList::ConstIterator end = d->mTempFiles.constEnd(); - for (QStringList::ConstIterator it = d->mTempFiles.constBegin(); it != end; ++it) { - QFile::remove(*it); - } - d->mTempFiles.clear(); - end = d->mTempDirs.constEnd(); - for (QStringList::ConstIterator it = d->mTempDirs.constBegin(); it != end; ++it) { - QDir(*it).rmdir(*it); - } - d->mTempDirs.clear(); -} - -void AttachmentTemporaryFilesDirs::slotRemoveTempFiles() -{ - forceCleanTempFiles(); - //Delete it after cleaning - deleteLater(); -} - -void AttachmentTemporaryFilesDirs::addTempFile(const QString &file) -{ - if (!d->mTempFiles.contains(file)) { - d->mTempFiles.append(file); - } -} - -void AttachmentTemporaryFilesDirs::addTempDir(const QString &dir) -{ - if (!d->mTempDirs.contains(dir)) { - d->mTempDirs.append(dir); - } -} - -QStringList AttachmentTemporaryFilesDirs::temporaryFiles() const -{ - return d->mTempFiles; -} - -QStringList AttachmentTemporaryFilesDirs::temporaryDirs() const -{ - return d->mTempDirs; -} - diff --git a/framework/src/domain/mime/mimetreeparser/attachmenttemporaryfilesdirs.h b/framework/src/domain/mime/mimetreeparser/attachmenttemporaryfilesdirs.h deleted file mode 100644 index bf65fcdb..00000000 --- a/framework/src/domain/mime/mimetreeparser/attachmenttemporaryfilesdirs.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - Copyright (c) 2013-2016 Montel Laurent - - This library is free software; you can redistribute it and/or modify it - under the terms of the GNU Library General Public License as published by - the Free Software Foundation; either version 2 of the License, or (at your - option) any later version. - - This library is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public - License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to the - Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - 02110-1301, USA. - -*/ - -#ifndef ATTACHMENTTEMPORARYFILESDIRS_H -#define ATTACHMENTTEMPORARYFILESDIRS_H - -#include -#include - -namespace MimeTreeParser -{ -class AttachmentTemporaryFilesDirsPrivate; - -class AttachmentTemporaryFilesDirs : public QObject -{ - Q_OBJECT -public: - explicit AttachmentTemporaryFilesDirs(QObject *parent = nullptr); - ~AttachmentTemporaryFilesDirs(); - - void addTempFile(const QString &file); - void addTempDir(const QString &dir); - QStringList temporaryFiles() const; - void removeTempFiles(); - void forceCleanTempFiles(); - - QStringList temporaryDirs() const; - - void setDelayRemoveAllInMs(int ms); - -private Q_SLOTS: - void slotRemoveTempFiles(); - -private: - AttachmentTemporaryFilesDirsPrivate *const d; -}; - -} - -#endif // ATTACHMENTTEMPORARYFILESDIRS_H diff --git a/framework/src/domain/mime/mimetreeparser/nodehelper.cpp b/framework/src/domain/mime/mimetreeparser/nodehelper.cpp index bbd705f9..a8af4e19 100644 --- a/framework/src/domain/mime/mimetreeparser/nodehelper.cpp +++ b/framework/src/domain/mime/mimetreeparser/nodehelper.cpp @@ -21,7 +21,6 @@ #include "mimetreeparser_debug.h" #include "partmetadata.h" #include "bodypart.h" -#include "attachmenttemporaryfilesdirs.h" #include #include diff --git a/framework/src/domain/mime/mimetreeparser/nodehelper.h b/framework/src/domain/mime/mimetreeparser/nodehelper.h index 3a39fb6e..6db6de05 100644 --- a/framework/src/domain/mime/mimetreeparser/nodehelper.h +++ b/framework/src/domain/mime/mimetreeparser/nodehelper.h @@ -32,14 +32,6 @@ class QUrl; class QTextCodec; -namespace MimeTreeParser -{ -class AttachmentTemporaryFilesDirs; -namespace Interface -{ -} -} - namespace MimeTreeParser { -- cgit v1.2.3