- fix: the "add bookmark" menu item is not correctly disabled on a bookmarked line
This commit is contained in:
parent
ff54e6c0e2
commit
24b771550c
1
NEWS.md
1
NEWS.md
|
@ -8,6 +8,7 @@ Version 0.7.2
|
|||
- enhancement: only editor area will receive file drop events
|
||||
- enhancement: change project file's folder by drag and drop in the project view
|
||||
- enhancement: open project file by drag it to the editor area
|
||||
- fix: the "add bookmark" menu item is not correctly disabled on a bookmarked line
|
||||
|
||||
Version 0.7.1
|
||||
- fix: can't add bookmark at a breakpoint line
|
||||
|
|
|
@ -2552,7 +2552,7 @@ void MainWindow::onEditorContextMenu(const QPoint &pos)
|
|||
ui->actionBreakpoint_property->setEnabled(editor->hasBreakpoint(line));
|
||||
ui->actionAdd_bookmark->setEnabled(
|
||||
line>=0 && editor->lines()->count()>0
|
||||
&& !editor->hasBreakpoint(line)
|
||||
&& !editor->hasBookmark(line)
|
||||
);
|
||||
ui->actionRemove_Bookmark->setEnabled(editor->hasBookmark(line));
|
||||
ui->actionModify_Bookmark_Description->setEnabled(editor->hasBookmark(line));
|
||||
|
|
|
@ -1833,8 +1833,10 @@ Qt::ItemFlags ProjectModel::flags(const QModelIndex &index) const
|
|||
if (p==mProject->node().get())
|
||||
return Qt::ItemIsEnabled | Qt::ItemIsDropEnabled;
|
||||
Qt::ItemFlags flags = Qt::ItemIsEnabled | Qt::ItemIsEditable | Qt::ItemIsSelectable | Qt::ItemIsDragEnabled;
|
||||
if (p->unitIndex<0)
|
||||
if (p->unitIndex<0) {
|
||||
flags.setFlag(Qt::ItemIsDropEnabled);
|
||||
flags.setFlag(Qt::ItemIsDragEnabled,false);
|
||||
}
|
||||
return flags;
|
||||
}
|
||||
|
||||
|
@ -1948,7 +1950,7 @@ QModelIndex ProjectModel::getParentIndex(FolderNode * node) const
|
|||
return createIndex(row,0,parent.get());
|
||||
}
|
||||
|
||||
bool ProjectModel::canDropMimeData(const QMimeData * data, Qt::DropAction action, int row, int column, const QModelIndex &parent) const
|
||||
bool ProjectModel::canDropMimeData(const QMimeData * data, Qt::DropAction action, int /*row*/, int /*column*/, const QModelIndex &parent) const
|
||||
{
|
||||
|
||||
if (!data || action != Qt::MoveAction)
|
||||
|
@ -1993,7 +1995,7 @@ Qt::DropActions ProjectModel::supportedDropActions() const
|
|||
return Qt::MoveAction;
|
||||
}
|
||||
|
||||
bool ProjectModel::dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent)
|
||||
bool ProjectModel::dropMimeData(const QMimeData *data, Qt::DropAction action, int /*row*/, int /*column*/, const QModelIndex &parent)
|
||||
{
|
||||
// check if the action is supported
|
||||
if (!data || action != Qt::MoveAction)
|
||||
|
|
Loading…
Reference in New Issue