Switch to unified view

a/src/qtgui/advsearch_w.cpp b/src/qtgui/advsearch_w.cpp
1
#ifndef lint
1
#ifndef lint
2
static char rcsid[] = "@(#$Id: advsearch_w.cpp,v 1.3 2006-09-12 10:11:36 dockes Exp $ (C) 2005 J.F.Dockes";
2
static char rcsid[] = "@(#$Id: advsearch_w.cpp,v 1.4 2006-09-13 08:13:36 dockes Exp $ (C) 2005 J.F.Dockes";
3
#endif
3
#endif
4
/*
4
/*
5
 *   This program is free software; you can redistribute it and/or modify
5
 *   This program is free software; you can redistribute it and/or modify
6
 *   it under the terms of the GNU General Public License as published by
6
 *   it under the terms of the GNU General Public License as published by
7
 *   the Free Software Foundation; either version 2 of the License, or
7
 *   the Free Software Foundation; either version 2 of the License, or
...
...
70
        this, SLOT(searchPB_clicked()));
70
        this, SLOT(searchPB_clicked()));
71
    connect(delAFiltypPB, SIGNAL(clicked()), 
71
    connect(delAFiltypPB, SIGNAL(clicked()), 
72
        this, SLOT(delAFiltypPB_clicked()));
72
        this, SLOT(delAFiltypPB_clicked()));
73
    connect(addAFiltypPB, SIGNAL(clicked()), 
73
    connect(addAFiltypPB, SIGNAL(clicked()), 
74
        this, SLOT(addAFiltypPB_clicked()));
74
        this, SLOT(addAFiltypPB_clicked()));
75
    connect(saveFileTypesPB, SIGNAL(clicked()), 
76
      this, SLOT(saveFileTypes()));
75
77
78
    // Initialize lists of accepted and ignored mime types from config
79
    // and settings
76
    list<string> types = rclconfig->getAllMimeTypes();
80
    list<string> types = rclconfig->getAllMimeTypes();
81
    noFiltypsLB->insertStringList(prefs.asearchIgnFilTyps); 
77
82
78
    QStringList ql;
83
    QStringList ql;
79
    for (list<string>::iterator it = types.begin(); it != types.end(); it++) {
84
    for (list<string>::iterator it = types.begin(); it != types.end(); it++) {
85
  if (prefs.asearchIgnFilTyps.findIndex(it->c_str())<0)
80
    ql.append(it->c_str());
86
        ql.append(it->c_str());
81
    }
87
    }
82
    yesFiltypsLB->insertStringList(ql);
88
    yesFiltypsLB->insertStringList(ql);
83
89
84
    subtreeCMB->insertStringList(prefs.asearchSubdirHist);
90
    subtreeCMB->insertStringList(prefs.asearchSubdirHist);
85
    subtreeCMB->setEditText("");
91
    subtreeCMB->setEditText("");
...
...
111
{
117
{
112
    for (unsigned int i = 0; i < yesFiltypsLB->count();i++) {
118
    for (unsigned int i = 0; i < yesFiltypsLB->count();i++) {
113
    yesFiltypsLB->setSelected(i, true);
119
    yesFiltypsLB->setSelected(i, true);
114
    }
120
    }
115
    delFiltypPB_clicked();
121
    delFiltypPB_clicked();
122
}
123
124
// Save current list of ignored file types to prefs
125
void AdvSearch::saveFileTypes()
126
{
127
    prefs.asearchIgnFilTyps.clear();
128
    for (unsigned int i = 0; i < noFiltypsLB->count();i++) {
129
  QListBoxItem *item = noFiltypsLB->item(i);
130
  prefs.asearchIgnFilTyps.append(item->text());
131
    }
132
    rwSettings(true);
116
}
133
}
117
134
118
// Move selected file types from the ignored to the searched box
135
// Move selected file types from the ignored to the searched box
119
void AdvSearch::addFiltypPB_clicked()
136
void AdvSearch::addFiltypPB_clicked()
120
{
137
{