~carlos-mazieri/ubuntu-filemanager-app/samba-actions-04

« back to all changes in this revision

Viewing changes to src/plugin/folderlistmodel/smb/qsambaclient/src/smbplaces.h

  • Committer: Tarmac
  • Author(s): carlos-mazieri
  • Date: 2015-06-21 19:46:08 UTC
  • mfrom: (420.1.1 samba-browsing-11-new)
  • Revision ID: tarmac-20150621194608-6wa6ih0hin5el77t
It replaces https://code.launchpad.net/~carlos-mazieri/ubuntu-filemanager-app/samba-browsing-11 which has a problem on the merge.

Approved by Ubuntu Phone Apps Jenkins Bot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/**************************************************************************
 
2
 *
 
3
 * Copyright 2014 Canonical Ltd.
 
4
 * Copyright 2014 Carlos J Mazieri <carlos.mazieri@gmail.com>
 
5
 *
 
6
 * This program is free software; you can redistribute it and/or modify
 
7
 * it under the terms of the GNU Lesser General Public License as published by
 
8
 * the Free Software Foundation; version 3.
 
9
 *
 
10
 * This program is distributed in the hope that it will be useful,
 
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
 * GNU Lesser General Public License for more details.
 
14
 *
 
15
 * You should have received a copy of the GNU Lesser General Public License
 
16
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
17
 *
 
18
 * File: smbplaces.h
 
19
 * Date: 27/12/2014
 
20
 */
 
21
 
 
22
#ifndef SMBPLACES_H
 
23
#define SMBPLACES_H
 
24
 
 
25
#include <QObject>
 
26
#include <QStringList>
 
27
 
 
28
class SmbPlacesThread;
 
29
 
 
30
 
 
31
/*!
 
32
 * \brief The SmbPlaces class gets the list of current Samba/CIFS shares
 
33
 */
 
34
 
 
35
class SmbPlaces : public QObject
 
36
{
 
37
    Q_OBJECT
 
38
public:
 
39
    explicit SmbPlaces(QObject *parent = 0);
 
40
    ~SmbPlaces();
 
41
 
 
42
public:
 
43
    /*!
 
44
     *  list all Samba/Cifs shares in sync mode, that means it may block any active UI
 
45
     *
 
46
     *  \return the list of the shares in the current network
 
47
     */
 
48
    Q_INVOKABLE   QStringList listPlacesSync();
 
49
 
 
50
    Q_INVOKABLE   QStringList gePlaces() const;
 
51
 
 
52
public slots:
 
53
    /*!
 
54
     *  list all Samba/Cifs shares in async mode, the job is made on a secondary thread
 
55
     *  that means it does not block any active UI
 
56
     *
 
57
     *  After the job is done the signal \ref sharesList is emitted within the current shares  list
 
58
     */
 
59
    void        listPlacesAsync();
 
60
 
 
61
signals:  
 
62
    void        sharesList(QStringList);
 
63
 
 
64
private slots:
 
65
    void        onSmbPlacesThreadFinished();
 
66
 
 
67
private:
 
68
    QStringList       m_sharesList;
 
69
    SmbPlacesThread * m_thread;
 
70
 
 
71
#if defined(REGRESSION_TEST_QSAMBACLIENT)
 
72
    friend class TestQSambaSuite;
 
73
#endif
 
74
 
 
75
};
 
76
 
 
77
#endif // SMBPLACES_H