mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
f14c14c383
commit
9598462830
9 changed files with 32 additions and 32 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue