From fae0bdb6114b43d67c0459155cb5941aa31ed031 Mon Sep 17 00:00:00 2001 From: Srivats P Date: Wed, 18 Mar 2020 20:56:07 +0530 Subject: [PATCH] Remove copy support from Logs Model XTableView now supports plain text copy for all models, so we don't need this code in Logs Model --- client/logsmodel.cpp | 26 -------------------------- client/logsmodel.h | 2 -- 2 files changed, 28 deletions(-) diff --git a/client/logsmodel.cpp b/client/logsmodel.cpp index 1aa8600..e5abc8f 100644 --- a/client/logsmodel.cpp +++ b/client/logsmodel.cpp @@ -20,7 +20,6 @@ along with this program. If not, see #include "logsmodel.h" #include -#include // XXX: Keep the enum in sync with it's string enum { @@ -114,31 +113,6 @@ Qt::DropActions LogsModel::supportedDropActions() const return Qt::IgnoreAction; // read-only model, doesn't accept any data } -QStringList LogsModel::mimeTypes() const -{ - return QStringList() << "text/plain"; -} - -QMimeData* LogsModel::mimeData(const QModelIndexList &indexes) const -{ - int lastRow = -1; - QString text; - foreach(QModelIndex index, indexes) { - if (index.row() != lastRow) { - if (!text.isEmpty()) - text.append("\n"); - } - else - text.append("\t"); - text.append(data(index).toString()); - lastRow = index.row(); - } - - QMimeData *mimeData = new QMimeData(); - mimeData->setText(text); - return mimeData; // caller is responsible for freeing! -} - // --------------------------------------------- // // Slots // --------------------------------------------- // diff --git a/client/logsmodel.h b/client/logsmodel.h index 8c7c937..0c23c93 100644 --- a/client/logsmodel.h +++ b/client/logsmodel.h @@ -45,8 +45,6 @@ public: QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; Qt::DropActions supportedDropActions() const; - QStringList mimeTypes() const; - QMimeData* mimeData(const QModelIndexList &indexes) const; public slots: void clear();