KUbuntu 14.04 support restored (#1298)

* - [NEW] Add new interface and functionality to manage database file extension. (Implements feature request #659)

* - [FIX] Fixed CMake file to src.pro

* - Applied changes requested by mgrojo to uniform code with sqlitebrowser standards
- Add "history" when closing editor window, but reopen before closing preferences
- Revert some changes done by QtCreator

* Refuse from previous commit

* Additional changes requested by MKleusberg:
- [CHG] Always add "All files (*)" to filters
- [FIX] Removed unused include

* merged from master

* Merge sqlitebrowser master

* [FIX] Fixed compatibility to compile on KUbuntu 14.04 with Qt 5.2.1

* [FIX] Fix Qt version for QOpenGLWidget support on previous commit

* [CHG] Uniformed QT_VERSION_CHECK style
[CHG] Reverted macOS check on Mainwindow for OpenGL context creation
This commit is contained in:
GortiZ
2018-05-20 15:56:01 +02:00
committed by Martin Kleusberg
parent b69e7cd034
commit e7752d7398
9 changed files with 85 additions and 7 deletions

View File

@@ -342,7 +342,18 @@ void EditTableDialog::itemChanged(QTreeWidgetItem *item, int column)
if(item->checkState(column) == Qt::Checked)
pk.push_back(field);
else
#if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0)
pk.removeAll(field);
#else
{
int idx = pk.indexOf (field);
while ( idx != -1 )
{
pk.remove (idx);
idx = pk.indexOf (field);
}
}
#endif
} else if(item->checkState(column) == Qt::Checked) {
// There is no primary key in the table yet. This means we need to add a default one.
m_table.addConstraint({field}, sqlb::ConstraintPtr(new sqlb::PrimaryKeyConstraint()));