mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-12 02:55:18 -04:00
reworked settings
now there is only one global object for loading and saving settings RshareSettings *Settings; the class RSettings can be used too, but it is not prefered, because the default settings has no affect git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2964 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
e68e6b54ef
commit
6baf56285b
39 changed files with 336 additions and 390 deletions
|
@ -728,19 +728,16 @@ SharedFilesDialog::fileAssotiationAction(const QString fileName)
|
|||
{
|
||||
QAction* result = 0;
|
||||
|
||||
RshareSettings* settings = new RshareSettings();
|
||||
//QSettings* settings= new QSettings(qApp->applicationDirPath()+"/sett.ini",
|
||||
// QSettings::IniFormat);
|
||||
settings->beginGroup("FileAssotiations");
|
||||
Settings->beginGroup("FileAssotiations");
|
||||
|
||||
QString key = AddFileAssociationDialog::cleanFileType(currentFile) ;
|
||||
if ( settings->contains(key) )
|
||||
if ( Settings->contains(key) )
|
||||
{
|
||||
result = new QAction(QIcon(IMAGE_PLAY), tr( "Open File" ), this );
|
||||
connect( result , SIGNAL( triggered() ),
|
||||
this, SLOT( runCommandForFile() ) );
|
||||
|
||||
currentCommand = (settings->value( key )).toString();
|
||||
currentCommand = (Settings->value( key )).toString();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -750,7 +747,7 @@ SharedFilesDialog::fileAssotiationAction(const QString fileName)
|
|||
this, SLOT( tryToAddNewAssotiation() ) );
|
||||
}
|
||||
|
||||
delete settings;
|
||||
Settings->endGroup();
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -783,15 +780,10 @@ SharedFilesDialog::tryToAddNewAssotiation()
|
|||
|
||||
if (ti==QDialog::Accepted)
|
||||
{
|
||||
RshareSettings settings;
|
||||
//QSettings settings( qApp->applicationDirPath()+"/sett.ini",
|
||||
// QSettings::IniFormat);
|
||||
settings.beginGroup("FileAssotiations");
|
||||
|
||||
QString currType = afad.resultFileType() ;
|
||||
QString currCmd = afad.resultCommand() ;
|
||||
|
||||
settings.setValue(currType, currCmd);
|
||||
Settings->setValueToGroup("FileAssotiations", currType, currCmd);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue