Commit 39d02485 authored by Jan Möbius's avatar Jan Möbius

Removed unused ini functions

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@11681 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 6d9bd36f
......@@ -811,16 +811,17 @@ bool initializeSettings() {
if ( ! configDir_.cd("Application Support") )
configDir_.mkdir("Application Support");
if ( ! configDir_.cd("OpenFlipper") ) {
configDir_.mkdir("OpenFlipper");
if ( ! configDir_.cd("OpenFlipper") ) {
std::cerr << "Unable to create config dir ~/Library/OpenFlipper" << std::endl;
if ( ! configDir_.cd("de.rwth-aachen.graphics.openflipper") ) {
configDir_.mkdir("de.rwth-aachen.graphics.openflipper");
if ( ! configDir_.cd("de.rwth-aachen.graphics.openflipper") ) {
std::cerr << "Unable to create config dir ~/Library/de.rwth-aachen.graphics.openflipper" << std::endl;
return false;
}
}
#else
configDir_ = QDir::home();
if ( ! configDir_.cd(".OpenFlipper") ) {
std::cerr << "2" << std::endl;
std::cerr << "Creating config Dir ~/.OpenFlipper" << std::endl;;
configDir_.mkdir(".OpenFlipper");
if ( ! configDir_.cd(".OpenFlipper") ) {
......@@ -828,6 +829,7 @@ bool initializeSettings() {
return false;
}
}
#endif
......
......@@ -42,7 +42,6 @@
#include "FileOptionsDialog.hh"
#include <OpenFlipper/INIFile/INIFile.hh>
#include <OpenFlipper/common/GlobalOptions.hh>
#include <QVBoxLayout>
......@@ -108,32 +107,6 @@ FileOptionsDialog::FileOptionsDialog(std::vector<fileTypes>& _supportedTypes, QS
}
}
//load defaults from ini file
QString filename = OpenFlipper::Options::configDirStr() + OpenFlipper::Options::dirSeparator() + "OpenFlipper.ini";
/// \todo Move to OpenFlipperSettings
INIFile ini;
if ( ini.connect(filename,false) ) {
for (int i=0; i < boxes_.count(); i++){
QString pluginName;
if ( ini.get_entry(pluginName, "LoadSave" , "Extension_" + _extensions[i] ) ){
for (int t=0; t < (boxes_[i])->count(); t++)
if ( (boxes_[i])->itemText(t) == pluginName ){
(boxes_[i])->setCurrentIndex(t);
break;
}
}
}
// close ini file
ini.disconnect();
} else {
std::cerr << (tr("Failed to connect to ini file %1").arg(filename)).toStdString() << std::endl;
}
QGroupBox* group = new QGroupBox(tr("Extensions with multiple plugins"));
group->setLayout(grid);
......
......@@ -220,9 +220,7 @@ void LoadWidget::loadFile(){
}
}
}
getPluginForExtensionINI(ext);
// display options for all dataTypes
if ( !optionsBox_->isChecked() ){
......@@ -294,8 +292,6 @@ void LoadWidget::saveFile(){
}
}
getPluginForExtensionINI(QStringList(fi.suffix()));
// display options for all dataTypes
if ( !optionsBox_->isChecked() ){
......@@ -492,32 +488,4 @@ void LoadWidget::slotSetPluginForExtension(QString _extension, int _pluginId ){
pluginForExtension_[ _extension ] = _pluginId;
}
void LoadWidget::getPluginForExtensionINI(QStringList _extensions){
QString filename = OpenFlipper::Options::configDirStr() + OpenFlipper::Options::dirSeparator() + "OpenFlipper.ini";
INIFile ini;
if ( ! ini.connect(filename,false) ) {
std::cerr << (tr("Failed to connect to ini file %1").arg(filename)).toStdString() << std::endl;
return;
}
for (int i=0; i < _extensions.count(); i++){
QString pluginName;
if ( ini.get_entry(pluginName, "LoadSave" , "Extension_" + _extensions[i] ) ){
for (uint t=0; t < supportedTypes_.size(); t++)
if ( supportedTypes_[t].name == pluginName ){
pluginForExtension_[ _extensions[i] ] = t;
break;
}
}
}
// close ini file
ini.disconnect();
}
......@@ -74,8 +74,6 @@ class LoadWidget : public QFileDialog
QStringList lastPaths;
std::vector<fileTypes>& supportedTypes_;
void getPluginForExtensionINI(QStringList _extensions);
public:
int showLoad();
int showSave(int _id, QString _filename);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment