git-svn-id: svn://db.shs.com.ru/libs@397 a8b55f48-bf90-11e4-a774-851b48703e85
This commit is contained in:
@@ -21,6 +21,7 @@ CDItem::CDItem(CDUtils::Interface * i, int _index, CDItem::CDItemType type, CDIt
|
||||
parent_ = parent;
|
||||
type_ = type;
|
||||
item_count = 0;
|
||||
expanded = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -319,6 +320,8 @@ Qt::ItemFlags CDItemModel::flags(const QModelIndex & index) const {
|
||||
f |= Qt::ItemIsEditable;
|
||||
if (index.column() == cValue && t.type() == "b")
|
||||
f |= Qt::ItemIsUserCheckable;
|
||||
if (index.column() == cName_Cmd)
|
||||
f |= Qt::ItemIsDragEnabled;
|
||||
}
|
||||
if (t.cd_type() == CDType::cdX) {
|
||||
if (index.column() == cXMode || index.column() == cXAvg)
|
||||
@@ -367,12 +370,13 @@ bool CDItemModel::setData(const QModelIndex & index, const QVariant & value, int
|
||||
QMimeData * CDItemModel::mimeData(const QModelIndexList & indexes) const {
|
||||
if (indexes.size() == 1) {
|
||||
QModelIndex index = indexes[0];
|
||||
if (index.isValid() && interface->cdType() == CDType::cdX) {
|
||||
if (index.isValid()/* && interface->cdType() == CDType::cdX*/) {
|
||||
CDItem * item = getItem(index);
|
||||
if (item) {
|
||||
CDType & t(interface->section(item->buildPath())[item->index_]);
|
||||
QMimeData * mime = new QMimeData();
|
||||
mime->setText(PI2QString(CDCore::pathToString(t.path())));
|
||||
mime->setText(PI2QString(CDCore::instance()->typeLetter(interface->cdType()) +
|
||||
CDCore::pathToString(t.path())));
|
||||
return mime;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user