Commit 56dc6e9b authored by Boudewijn Rempt's avatar Boudewijn Rempt

Remove useless abstrace base class KoResourceModelBase

parent 59aa2bbc
...@@ -48,7 +48,6 @@ set(kritawidgets_LIB_SRCS ...@@ -48,7 +48,6 @@ set(kritawidgets_LIB_SRCS
KoLineStyleItemDelegate.cpp KoLineStyleItemDelegate.cpp
KoLineStyleModel.cpp KoLineStyleModel.cpp
KoResourceFiltering.cpp KoResourceFiltering.cpp
KoResourceModelBase.cpp
KoTitledTabWidget.cpp KoTitledTabWidget.cpp
KoToolBoxButton.cpp KoToolBoxButton.cpp
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
#include <math.h> #include <math.h>
KoResourceModel::KoResourceModel(QSharedPointer<KoAbstractResourceServerAdapter> resourceAdapter, QObject * parent) KoResourceModel::KoResourceModel(QSharedPointer<KoAbstractResourceServerAdapter> resourceAdapter, QObject * parent)
: KoResourceModelBase(parent) : QAbstractTableModel(parent)
, m_resourceAdapter(resourceAdapter) , m_resourceAdapter(resourceAdapter)
, m_columnCount(4) , m_columnCount(4)
{ {
......
...@@ -23,14 +23,15 @@ ...@@ -23,14 +23,15 @@
#include <QSharedPointer> #include <QSharedPointer>
#include "KoResourceModelBase.h" #include "QAbstractTableModel"
#include "kritawidgets_export.h" #include "kritawidgets_export.h"
class KoAbstractResourceServerAdapter; class KoAbstractResourceServerAdapter;
class KoResource; class KoResource;
/// The resource model managing the resource data /// The resource model managing the resource data
class KRITAWIDGETS_EXPORT KoResourceModel : public KoResourceModelBase class KRITAWIDGETS_EXPORT KoResourceModel : public QAbstractTableModel
{ {
Q_OBJECT Q_OBJECT
public: public:
...@@ -56,29 +57,29 @@ public: ...@@ -56,29 +57,29 @@ public:
TagsRole TagsRole
}; };
QModelIndex indexFromResource(KoResource* resource) const override; QModelIndex indexFromResource(KoResource* resource) const;
/// facade for KoAbstractResourceServerAdapter /// facade for KoAbstractResourceServerAdapter
QString extensions() const; QString extensions() const;
void importResourceFile(const QString &filename); void importResourceFile(const QString &filename);
void importResourceFile(const QString &filename, bool fileCreation); void importResourceFile(const QString &filename, bool fileCreation);
bool removeResource(KoResource* resource) override; bool removeResource(KoResource* resource);
void removeResourceFile(const QString & filename); void removeResourceFile(const QString & filename);
QStringList assignedTagsList(KoResource *resource) const override; QStringList assignedTagsList(KoResource *resource) const;
void addTag(KoResource* resource, const QString& tag) override; void addTag(KoResource* resource, const QString& tag);
void deleteTag( KoResource* resource, const QString& tag) override; void deleteTag( KoResource* resource, const QString& tag);
QStringList tagNamesList() const override; QStringList tagNamesList() const;
QStringList searchTag(const QString& lineEditText); QStringList searchTag(const QString& lineEditText);
void enableResourceFiltering(bool enable) override; void enableResourceFiltering(bool enable);
void setCurrentTag(const QString& currentTag) override; void setCurrentTag(const QString& currentTag);
void searchTextChanged(const QString& searchString) override; void searchTextChanged(const QString& searchString);
void updateServer() override; void updateServer();
int resourcesCount() const override; int resourcesCount() const;
QList<KoResource *> currentlyVisibleResources() const override; QList<KoResource *> currentlyVisibleResources() const;
QList<KoResource *> serverResources() const override; QList<KoResource *> serverResources() const;
void tagCategoryMembersChanged() override; void tagCategoryMembersChanged();
void tagCategoryAdded(const QString& tag) override; void tagCategoryAdded(const QString& tag);
void tagCategoryRemoved(const QString& tag) override; void tagCategoryRemoved(const QString& tag);
QString serverType() const; QString serverType() const;
...@@ -95,12 +96,12 @@ private: ...@@ -95,12 +96,12 @@ private:
void doSafeLayoutReset(KoResource *activateAfterReformat); void doSafeLayoutReset(KoResource *activateAfterReformat);
private Q_SLOTS: private Q_SLOTS:
void resourceAdded(KoResource *resource) override; void resourceAdded(KoResource *resource);
void resourceRemoved(KoResource *resource) override; void resourceRemoved(KoResource *resource);
void resourceChanged(KoResource *resource) override; void resourceChanged(KoResource *resource);
void tagBoxEntryWasModified() override; void tagBoxEntryWasModified();
void tagBoxEntryWasAdded(const QString& tag) override; void tagBoxEntryWasAdded(const QString& tag);
void tagBoxEntryWasRemoved(const QString& tag) override; void tagBoxEntryWasRemoved(const QString& tag);
private: private:
QSharedPointer<KoAbstractResourceServerAdapter> m_resourceAdapter; QSharedPointer<KoAbstractResourceServerAdapter> m_resourceAdapter;
......
/* This file is part of the KDE project
* Copyright (C) 2014 Victor Lafon <metabolic.ewilan@hotmail.fr>
* Copyright (c) 2013 Sascha Suelzer <s.suelzer@gmail.com>
*
* 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 "KoResourceModelBase.h"
KoResourceModelBase::KoResourceModelBase(QObject *parent)
: QAbstractTableModel(parent)
{
}
KoResourceModelBase::~KoResourceModelBase()
{
}
/* This file is part of the KDE project
* Copyright (C) 2014 Victor Lafon <metabolic.ewilan@hotmail.fr>
*
* 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 KORESOURCEMODELBASE_H
#define KORESOURCEMODELBASE_H
#include <QAbstractTableModel>
#include "kritawidgets_export.h"
class KoResource;
/// The resource model managing the resource data
class KRITAWIDGETS_EXPORT KoResourceModelBase : public QAbstractTableModel
{
Q_OBJECT
public:
explicit KoResourceModelBase(QObject * parent = 0 );
~KoResourceModelBase() override;
/// reimplemented
int rowCount(const QModelIndex &parent = QModelIndex()) const override =0;
/// reimplemented
int columnCount ( const QModelIndex & parent = QModelIndex() ) const override =0;
/// reimplemented
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override =0;
/// reimplemented
QModelIndex index ( int row, int column = 0, const QModelIndex & parent = QModelIndex() ) const override =0;
virtual QModelIndex indexFromResource(KoResource* resource) const =0;
virtual QStringList assignedTagsList(KoResource *resource) const =0;
virtual bool removeResource(KoResource* resource) =0;
virtual void addTag(KoResource* resource, const QString& tag) =0;
virtual void deleteTag(KoResource *resource, const QString &tag) =0;
virtual int resourcesCount() const =0;
virtual QList<KoResource *> currentlyVisibleResources() const =0;
virtual void updateServer() =0;
virtual void enableResourceFiltering(bool enable) =0;
virtual void searchTextChanged(const QString& searchString) =0;
virtual QStringList tagNamesList() const =0;
virtual void setCurrentTag(const QString& currentTag) =0;
virtual QList<KoResource *> serverResources() const =0;
virtual void tagCategoryMembersChanged() =0;
virtual void tagCategoryAdded(const QString& tag) =0;
virtual void tagCategoryRemoved(const QString& tag) =0;
private Q_SLOTS:
virtual void tagBoxEntryWasModified() =0;
virtual void tagBoxEntryWasAdded(const QString& tag) =0;
virtual void tagBoxEntryWasRemoved(const QString& tag) =0;
virtual void resourceAdded(KoResource *resource) =0;
virtual void resourceRemoved(KoResource *resource) =0;
virtual void resourceChanged(KoResource* resource) =0;
};
#endif // KORESOURCEMODELBASE_H
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