Importance code refactoring related to the "preferences" code - Greatly improves performance

This commit is contained in:
Christophe Dumez
2010-11-16 20:34:31 +00:00
parent a640b08414
commit e5032a52c4
26 changed files with 976 additions and 1142 deletions

View File

@@ -56,6 +56,7 @@
torrentAdditionDialog::torrentAdditionDialog(QWidget *parent) :
QDialog(parent), old_label(""), hidden_height(0) {
const Preferences pref;
setupUi(this);
setAttribute(Qt::WA_DeleteOnClose);
// Set Properties list model
@@ -77,8 +78,8 @@ torrentAdditionDialog::torrentAdditionDialog(QWidget *parent) :
// Remember columns width
readSettings();
//torrentContentList->header()->setResizeMode(0, QHeaderView::Stretch);
defaultSavePath = Preferences::getSavePath();
appendLabelToSavePath = Preferences::appendTorrentLabel();
defaultSavePath = pref.getSavePath();
appendLabelToSavePath = pref.appendTorrentLabel();
QString display_path = defaultSavePath.replace("\\", "/");
if(!display_path.endsWith("/"))
display_path += "/";
@@ -88,7 +89,7 @@ torrentAdditionDialog::torrentAdditionDialog(QWidget *parent) :
#endif
savePathTxt->addItem(display_path);
if(Preferences::addTorrentsInPause()) {
if(pref.addTorrentsInPause()) {
addInPause->setChecked(true);
//addInPause->setEnabled(false);
}