~ubuntu-branches/ubuntu/intrepid/kid3/intrepid

« back to all changes in this revision

Viewing changes to kid3/dirlist.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Michele Angrisano
  • Date: 2008-01-09 23:20:54 UTC
  • mfrom: (1.1.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20080109232054-gtcjxz4ahdnzbt01
Tags: 0.10-1ubuntu1
* Merge from Debian unstable, remaining changes:
  - debian/rules:
    + Use dh_icons instead dh_iconcache.
  - debian/control:
    + Update maintainer field.

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
 * \b Project: Kid3
6
6
 * \author Urs Fleisch
7
7
 * \date 5 Jul 2005
 
8
 *
 
9
 * Copyright (C) 2005-2007  Urs Fleisch
 
10
 *
 
11
 * This file is part of Kid3.
 
12
 *
 
13
 * Kid3 is free software; you can redistribute it and/or modify
 
14
 * it under the terms of the GNU General Public License as published by
 
15
 * the Free Software Foundation; either version 2 of the License, or
 
16
 * (at your option) any later version.
 
17
 *
 
18
 * Kid3 is distributed in the hope that it will be useful,
 
19
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
20
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
21
 * GNU General Public License for more details.
 
22
 *
 
23
 * You should have received a copy of the GNU General Public License
 
24
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
8
25
 */
9
26
 
10
27
#include "dirlist.h"
14
31
 
15
32
/**
16
33
 * Constructor.
 
34
 * @param parent parent widget
17
35
 */
18
 
DirList::DirList(QWidget* parent, const char* name, Qt::WFlags f) :
19
 
        Q3ListBox(parent, name, f) {}
 
36
DirList::DirList(QWidget* parent) :
 
37
#if QT_VERSION >= 0x040000
 
38
        QListWidget(parent)
 
39
#else
 
40
        QListBox(parent)
 
41
#endif
 
42
{}
20
43
 
21
44
/**
22
45
 * Destructor.
35
58
                clear();
36
59
                m_dirname = name;
37
60
                QDir dir(file.filePath());
38
 
                insertStringList(dir.entryList(QDir::Dirs | QDir::Drives));
 
61
                QCM_addItems(dir.entryList(QDir::Dirs | QDir::Drives));
39
62
                if (!m_entryToSelect.isEmpty()) {
40
 
                        Q3ListBoxItem* lbi = findItem(m_entryToSelect);
 
63
#if QT_VERSION >= 0x040000
 
64
                        QList<QListWidgetItem*> items =
 
65
                                findItems(m_entryToSelect, Qt::MatchStartsWith);
 
66
                        QListWidgetItem* lbi = items.empty() ? 0 : items.front();
 
67
#else
 
68
                        QListBoxItem* lbi = findItem(m_entryToSelect);
 
69
#endif
41
70
                        if (lbi) {
42
71
                                setCurrentItem(lbi);
43
72
                        }