~ubuntu-branches/ubuntu/vivid/smb4k/vivid

« back to all changes in this revision

Viewing changes to core/smb4khomesshareshandler.h

  • Committer: Package Import Robot
  • Author(s): Fathi Boudra
  • Date: 2012-05-19 18:54:34 UTC
  • mfrom: (1.1.20)
  • Revision ID: package-import@ubuntu.com-20120519185434-duffny2n87214n1n
Tags: 1.0.1-1
* New upstream release.
* Update debian/compat: bump to 9.
* Update debian/control:
  - bump debhelper to 9.
  - bump kdelibs5-dev build dependency to 4:4.4.0.
  - bump Standards-Version to 3.9.3 (no changes needed).
  - Replace smbfs dependency by cifs-utils. (Closes: #638162)
* Update debian/copyright:
  - update upstream URL.
  - update upstream e-mail.
* Update debian/smb4k.lintian-overrides file.
* Update debian/watch file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
    smb4khomesshareshandler  -  This class handles the homes shares.
3
3
                             -------------------
4
4
    begin                : Do Aug 10 2006
5
 
    copyright            : (C) 2006-2008 by Alexander Reinholdt
6
 
    email                : dustpuppy@users.berlios.de
 
5
    copyright            : (C) 2006-2011 by Alexander Reinholdt
 
6
    email                : alexander.reinholdt@kdemail.net
7
7
 ***************************************************************************/
8
8
 
9
9
/***************************************************************************
19
19
 *                                                                         *
20
20
 *   You should have received a copy of the GNU General Public License     *
21
21
 *   along with this program; if not, write to the                         *
22
 
 *   Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,   *
23
 
 *   MA  02111-1307 USA                                                    *
 
22
 *   Free Software Foundation, 51 Franklin Street, Suite 500, Boston,      *
 
23
 *   MA 02110-1335 USA                                                     *
24
24
 ***************************************************************************/
25
25
 
26
26
#ifndef SMB4KHOMESSHARESHANDLER_H
44
44
// forward declarations
45
45
class Smb4KShare;
46
46
class Smb4KAuthInfo;
 
47
class Smb4KHomesUsers;
 
48
class Smb4KHomesSharesHandlerPrivate;
47
49
 
48
50
 
49
51
/**
50
52
 * This class belongs to the core of Smb4K and takes care of the
51
53
 * user names that are/were defined for a certain 'homes' share.
52
54
 *
53
 
 * @author Alexander Reinholdt <dustpuppy@users.berlios.de>
 
55
 * @author Alexander Reinholdt <alexander.reinholdt@kdemail.net>
54
56
 */
55
57
 
56
58
class KDE_EXPORT Smb4KHomesSharesHandler : public QObject
67
69
 
68
70
    /**
69
71
     * This function will open a dialog where the user has to define a
70
 
     * user name to access a 'homes' share. The name of @p share will be set accordingly.
 
72
     * user name to access a 'homes' share. You also can define if the 
 
73
     * user name should be overwritten in case one has already been set
 
74
     * (default is TRUE).
 
75
     *
 
76
     * In case that a new username is set by this function, the password
 
77
     * is cleared.
71
78
     *
72
79
     * @param share       The share that is representing the homes share
 
80
     * 
 
81
     * @param overwrite   Overwrite user name or not
73
82
     *
74
 
     * @param parent      The parent widget. If you go with the default value 0 and
75
 
     *                    @ref kapp->activeWindow() is not NULL, it will be used as parent.
 
83
     * @param parent      The parent widget
76
84
     *
77
85
     * @returns TRUE if user has been chosen and FALSE otherwise.
78
86
     */
79
 
    bool specifyUser( Smb4KShare *share,
 
87
    bool specifyUser( Smb4KShare *share, 
 
88
                      bool overwrite = true, 
80
89
                      QWidget *parent = 0 );
81
 
 
82
 
    /**
83
 
     * Read and set the user names that are defined for the 'homes' share represented
84
 
     * by @p share. In most cases you do not need to use this function, because the 'homes'
85
 
     * share will already carry the list of users with it.
86
 
     *
87
 
     * @param share       The 'homes' share
88
 
     *
89
 
     * @returns the list of user names for this homes share.
90
 
     */
91
 
    void setHomesUsers( Smb4KShare *share );
92
 
 
93
 
    /**
94
 
     * Read and set the user names that are defined for the 'homes' share represented
95
 
     * by @p authInfo. In most cases you do not need to use this function, because the
96
 
     * authentication information will already carry the homes users.
97
 
     *
98
 
     * If this authentication information does not represent a homes share, this function
99
 
     * will just return.
100
 
     *
101
 
     * @param authInfo    The authentication information
102
 
     */
103
 
    void setHomesUsers( Smb4KAuthInfo *authInfo );
104
 
 
 
90
    
 
91
    /**
 
92
     * Return the list of users defined for a certain homes share.
 
93
     * 
 
94
     * @param share       The share
 
95
     * 
 
96
     * @returns a list of users
 
97
     */
 
98
    QStringList homesUsers( Smb4KShare *share );
 
99
    
105
100
  protected slots:
106
101
    /**
107
 
     * Is connected to the textChanged() signal of the combo box
108
 
     * in the "Specify User" dialog.
109
 
     *
110
 
     * @param text        The text in the combo box
111
 
     */
112
 
    void slotTextChanged( const QString &text );
113
 
 
114
 
    /**
115
 
     * This slot is called if the User1 button, i.e. the "Clear" button
116
 
     * in the "Specify User" dialog has been clicked. It removes all
117
 
     * entries from the combo box.
118
 
     */
119
 
    void slotClearClicked();
 
102
     * Called when the application goes down
 
103
     */
 
104
    void slotAboutToQuit();
120
105
 
121
106
  private:
122
107
    /**
138
123
     * Save the host and user names.
139
124
     */
140
125
    void writeUserNames();
141
 
 
142
 
    /**
143
 
     * Find a particular share in the list. This function takes @p share,
144
 
     * extracts the needed information and searches the list if a homes
145
 
     * share with the same workgroup and host name is defined. If it cannot
146
 
     * find such a share, NULL is returns and the share otherwise.
147
 
     *
148
 
     * @param share           The share that is searched
149
 
     *
150
 
     * @returns a pointer to the share carrying the needed information or NULL.
151
 
     */
152
 
    Smb4KShare *findShare( Smb4KShare *share );
153
 
 
154
 
    /**
155
 
     * Find a particular share in the list. This function takes @p authInfo,
156
 
     * extracts the needed information and searches the list if a homes
157
 
     * share with the same workgroup and host name is defined. If it cannot
158
 
     * find such a share, NULL is returns and the share otherwise.
159
 
     *
160
 
     * @param authInfo        The authentication information
161
 
     *
162
 
     * @returns a pointer to the share carrying the needed information or NULL.
163
 
     */
164
 
    Smb4KShare *findShare( Smb4KAuthInfo *authInfo );
165
 
 
166
 
    /**
167
 
     * This is the dialog that's shown the user when he/she has to
168
 
     * provide a user name.
169
 
     */
170
 
    KDialog *m_dlg;
171
 
 
172
 
    /**
173
 
     * This map carries all information about the homes shares.
174
 
     */
175
 
    QList<Smb4KShare> m_list;
 
126
    
 
127
    /**
 
128
     * Find the homes user for a specific share
 
129
     */
 
130
    void findHomesUsers( Smb4KShare *share, 
 
131
                         QStringList *users );
 
132
    
 
133
    /**
 
134
     * Add user to a homes share
 
135
     */
 
136
    void addHomesUsers( Smb4KShare *share,
 
137
                        QStringList *users );
 
138
    
 
139
    /**
 
140
     * The list of shares with homes users
 
141
     */
 
142
    QList<Smb4KHomesUsers> m_homes_users;
176
143
};
177
144
 
178
145
#endif