~ubuntu-branches/ubuntu/maverick/amarok/maverick-backports

« back to all changes in this revision

Viewing changes to src/dialogs/CollectionSetup.h

  • Committer: Bazaar Package Importer
  • Author(s): Scott Kitterman
  • Date: 2011-03-03 10:20:39 UTC
  • mfrom: (126.1.8 natty)
  • Revision ID: james.westby@ubuntu.com-20110303102039-a408rug513n4qbin
Tags: 2:2.4.0-0ubuntu4~maverick1
* Source backprt to maverick (LP: #728447)
  - Drop version requirement on libindicate-qt-dev build-dep

Show diffs side-by-side

added added

removed removed

Lines of Context:
41
41
        ~CollectionSetupTreeView();
42
42
 
43
43
    protected slots:
 
44
        /** Shows a context menu if the right mouse button is pressed over a directory. */
44
45
        void slotPressed( const QModelIndex &index );
45
46
        void slotRescanDirTriggered();
46
47
 
67
68
        QStringList dirs() const { return m_dirs; }
68
69
        bool recursive() const { return m_recursive && m_recursive->isChecked(); }
69
70
        bool monitor() const { return m_monitor && m_monitor->isChecked(); }
 
71
        bool writeBack() const { return m_writeBack&& m_writeBack->isChecked(); }
 
72
        bool writeBackStatistics() const { return m_writeBackStatistics && m_writeBackStatistics->isChecked(); }
 
73
        bool writeBackCover() const { return m_writeBackCover && m_writeBackCover->isChecked(); }
70
74
        bool charset() const { return m_charset && m_charset->isChecked(); }
71
75
 
72
76
        const QString modelFilePath( const QModelIndex &index ) const;
85
89
        QStringList m_dirs;
86
90
        QCheckBox *m_recursive;
87
91
        QCheckBox *m_monitor;
 
92
        QCheckBox *m_writeBack;
 
93
        QCheckBox *m_writeBackStatistics;
 
94
        QCheckBox *m_writeBackCover;
88
95
        QCheckBox *m_charset;
89
96
};
90
97
 
107
114
 
108
115
        private:
109
116
            bool ancestorChecked( const QString &path ) const;
 
117
            QStringList allCheckedAncestors( const QString &path ) const;
110
118
            bool descendantChecked( const QString &path ) const;
111
119
            bool isForbiddenPath( const QString &path ) const;
112
 
            bool recursive() const { return CollectionSetup::instance() && CollectionSetup::instance()->recursive(); } // simply for convenience
 
120
            void checkRecursiveSubfolders( const QString &root, const QString &excludePath );
 
121
            inline bool recursive() const
 
122
            {
 
123
                // Simply for convenience
 
124
                return CollectionSetup::instance() && CollectionSetup::instance()->recursive();
 
125
            }
 
126
 
 
127
            static inline QString normalPath( const QString &path )
 
128
            {
 
129
                return path.endsWith( '/' ) ? path : path + '/';
 
130
            }
 
131
 
113
132
            QSet<QString> m_checked;
114
133
    };
115
134