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
This commit is contained in:
parent
e6213a90ac
commit
fae0bdb611
@ -20,7 +20,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
#include "logsmodel.h"
|
||||
|
||||
#include <QBrush>
|
||||
#include <QMimeData>
|
||||
|
||||
// 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
|
||||
// --------------------------------------------- //
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user