summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2013-05-21 19:34:03 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-05-21 19:34:03 -0700
commit238c80a70888f6f1850083205e2177d71254c0ae (patch)
tree5242b9a4eec12b71789d57f3787a00c9330eec0e
parent1752257fbb527fb09fa34e83be4a59caddc95cd2 (diff)
parentf7c78a20bd21d9bcd9f814c53fac683f5ff1f66a (diff)
downloadsubsurface-238c80a70888f6f1850083205e2177d71254c0ae.tar.gz
Merge branch 'microFixes' of https://github.com/tcanabrava/subsurface
-rw-r--r--qt-gui.cpp5
-rw-r--r--qt-ui/divelistview.cpp8
-rw-r--r--qt-ui/mainwindow.cpp4
3 files changed, 13 insertions, 4 deletions
diff --git a/qt-gui.cpp b/qt-gui.cpp
index dfc1df19d..aa4765fe5 100644
--- a/qt-gui.cpp
+++ b/qt-gui.cpp
@@ -61,6 +61,9 @@ const char *existing_filename;
void init_qt_ui(int *argcp, char ***argvp)
{
application->installTranslator(new Translator(application));
+ QCoreApplication::setOrganizationName("hohndel");
+ QCoreApplication::setOrganizationDomain("hohndel.org");
+ QCoreApplication::setApplicationName("Subsurface");
MainWindow *window = new MainWindow();
window->show();
}
@@ -78,7 +81,7 @@ void init_ui(int *argcp, char ***argvp)
QTextCodec::setCodecForCStrings(QTextCodec::codecForMib(106));
#endif
- QSettings settings("hohndel.org","subsurface");
+ QSettings settings;
settings.beginGroup("GeneralSettings");
v = settings.value(QString("default_filename"));
if (v.isValid()) {
diff --git a/qt-ui/divelistview.cpp b/qt-ui/divelistview.cpp
index 248a29634..9ee99394b 100644
--- a/qt-ui/divelistview.cpp
+++ b/qt-ui/divelistview.cpp
@@ -48,15 +48,20 @@ void DiveListView::reload()
QSettings s;
s.beginGroup("DiveListColumnState");
for(int i = 0; i < model()->columnCount(); i++){
- QString title = QString("show %1").arg( model()->headerData( i, Qt::Horizontal).toString());
+ QString title = QString("show %1").arg(model()->headerData( i, Qt::Horizontal).toString());
QAction *a = new QAction(title, header());
a->setCheckable(true);
a->setChecked( s.value(title, true).toBool());
a->setProperty("index", i);
connect(a, SIGNAL(triggered(bool)), this, SLOT(hideColumnByIndex()));
header()->addAction(a);
+ if (a->isChecked())
+ showColumn(true);
+ else
+ hideColumn(false);
}
s.endGroup();
+ s.sync();
}
}
@@ -70,6 +75,7 @@ void DiveListView::hideColumnByIndex()
s.beginGroup("DiveListColumnState");
s.setValue(action->text(), action->isChecked());
s.endGroup();
+ s.sync();
if (action->isChecked())
showColumn(action->property("index").toInt());
diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp
index 6ed810adb..deaab4715 100644
--- a/qt-ui/mainwindow.cpp
+++ b/qt-ui/mainwindow.cpp
@@ -323,7 +323,7 @@ void MainWindow::readSettings()
{
int i;
QVariant v;
- QSettings settings("hohndel.org","subsurface");
+ QSettings settings;
settings.beginGroup("MainWindow");
QSize sz = settings.value("size").value<QSize>();
@@ -417,7 +417,7 @@ void MainWindow::readSettings()
void MainWindow::writeSettings()
{
int i;
- QSettings settings("hohndel.org","subsurface");
+ QSettings settings;
settings.beginGroup("MainWindow");
settings.setValue("size",size());