diff options
| author | Tannin <devnull@localhost> | 2015-05-12 18:56:44 +0200 |
|---|---|---|
| committer | Tannin <devnull@localhost> | 2015-05-12 18:56:44 +0200 |
| commit | 90365041f463f6c062b154e94fedbf75f96fb880 (patch) | |
| tree | 5f8161811b3245ae85238945c7ab28cea242360c /src | |
| parent | 183b5715609b309431d8040101635ef9ac0843bf (diff) | |
workaround to prevent repeated checking of mods with the mouse was interpreted
as double click
Diffstat (limited to 'src')
| -rw-r--r-- | src/mainwindow.cpp | 7 | ||||
| -rw-r--r-- | src/modlist.cpp | 6 | ||||
| -rw-r--r-- | src/modlist.h | 4 |
3 files changed, 16 insertions, 1 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 5a2ef6fd..44ccc642 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -2538,6 +2538,12 @@ void MainWindow::on_modList_doubleClicked(const QModelIndex &index) if (!index.isValid()) {
return;
}
+
+ if (m_OrganizerCore.modList()->timeElapsedSinceLastChecked() <= QApplication::doubleClickInterval()) {
+ // don't interpret double click if we only just checked a mod
+ return;
+ }
+
QModelIndex sourceIdx = mapToModel(m_OrganizerCore.modList(), index);
if (!sourceIdx.isValid()) {
return;
@@ -2545,7 +2551,6 @@ void MainWindow::on_modList_doubleClicked(const QModelIndex &index) try {
m_ContextRow = m_ModListSortProxy->mapToSource(index).row();
-// displayModInformation(m_ModListSortProxy->mapToSource(index).row());
displayModInformation(sourceIdx.row());
// workaround to cancel the editor that might have opened because of
// selection-click
diff --git a/src/modlist.cpp b/src/modlist.cpp index 8c1d56b7..e05935ef 100644 --- a/src/modlist.cpp +++ b/src/modlist.cpp @@ -454,6 +454,7 @@ bool ModList::setData(const QModelIndex &index, const QVariant &value, int role) if (m_Profile->modEnabled(modID) != enabled) {
m_Profile->setModEnabled(modID, enabled);
m_Modified = true;
+ m_LastCheck.restart();
emit modlist_changed(index, role);
}
result = true;
@@ -665,6 +666,11 @@ void ModList::disconnectSlots() { m_ModStateChanged.disconnect_all_slots();
}
+int ModList::timeElapsedSinceLastChecked() const
+{
+ return m_LastCheck.elapsed();
+}
+
IModList::ModStates ModList::state(unsigned int modIndex) const
{
IModList::ModStates result;
diff --git a/src/modlist.h b/src/modlist.h index 6a10cb3e..d2cd00ce 100644 --- a/src/modlist.h +++ b/src/modlist.h @@ -111,6 +111,8 @@ public: void disconnectSlots();
+ int timeElapsedSinceLastChecked() const;
+
public:
/// \copydoc MOBase::IModList::displayName
@@ -311,6 +313,8 @@ private: std::map<ModInfo::EContent, std::tuple<QString, QString> > m_ContentIcons;
+ QTime m_LastCheck;
+
};
#endif // MODLIST_H
|
