summaryrefslogtreecommitdiffstats
path: root/qt-ui/subsurfacewebservices.cpp
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@intel.com>2014-04-17 11:34:21 -0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-04-17 08:37:31 -0700
commit95984628302bee02af3e82ac305b5e3bb4842533 (patch)
tree56b104b93b6786e4314e88d4a9164d4eaae67178 /qt-ui/subsurfacewebservices.cpp
parentf14c14c383763c73de1a6ec681b017517235f2f6 (diff)
downloadsubsurface-95984628302bee02af3e82ac305b5e3bb4842533.tar.gz
Removed the globals 'userid' and 'save_userid_local' variables
This is a preferences setting, it should belong to the preferences structure. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/subsurfacewebservices.cpp')
-rw-r--r--qt-ui/subsurfacewebservices.cpp25
1 files changed, 4 insertions, 21 deletions
diff --git a/qt-ui/subsurfacewebservices.cpp b/qt-ui/subsurfacewebservices.cpp
index 50f195635..87cd6006e 100644
--- a/qt-ui/subsurfacewebservices.cpp
+++ b/qt-ui/subsurfacewebservices.cpp
@@ -313,16 +313,16 @@ void WebServices::resetState()
SubsurfaceWebServices::SubsurfaceWebServices(QWidget *parent, Qt::WindowFlags f) : WebServices(parent, f)
{
QSettings s;
- if (!save_userid_local || !*userid)
+ if (!prefs.save_userid_local || !*prefs.userid)
ui.userID->setText(s.value("subsurface_webservice_uid").toString().toUpper());
else
- ui.userID->setText(userid);
+ ui.userID->setText(prefs.userid);
hidePassword();
hideUpload();
ui.progressBar->setFormat("Enter User ID and click Download");
ui.progressBar->setRange(0, 1);
ui.progressBar->setValue(-1);
- ui.saveUidLocal->setChecked(save_userid_local);
+ ui.saveUidLocal->setChecked(prefs.save_userid_local);
}
void SubsurfaceWebServices::buttonClicked(QAbstractButton *button)
@@ -349,7 +349,7 @@ void SubsurfaceWebServices::buttonClicked(QAbstractButton *button)
set_save_userid_local(qSaveUid);
if (qSaveUid) {
QString qSettingUid = s.value("subsurface_webservice_uid").toString();
- QString qFileUid = QString::fromStdString(userid);
+ QString qFileUid = QString(prefs.userid);
bool s_eq_d = (qSettingUid == qDialogUid);
bool d_eq_f = (qDialogUid == qFileUid);
if (!d_eq_f || s_eq_d)
@@ -904,20 +904,3 @@ void DivelogsDeWebServices::buttonClicked(QAbstractButton *button)
break;
}
}
-
-#define MAX_USERID_SIZE 32
-short save_userid_local = false;
-char *userid = NULL;
-void set_save_userid_local(short value)
-{
- QSettings s;
- s.setValue("save_uid_local", value);
- save_userid_local = value;
-}
-
-void set_userid(char *rUserId)
-{
- userid = (char *) malloc(MAX_USERID_SIZE);
- if (userid && rUserId)
- strcpy(userid, rUserId);
-}