[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: playground/network/smb4k/core
From: Alexander Reinholdt <alexander.reinholdt () kdemail ! net>
Date: 2013-06-08 15:51:17
Message-ID: 20130608155117.31829AC85D () svn ! kde ! org
[Download RAW message or body]
SVN commit 1357343 by areinholdt:
- Still improving plasmoid.
- Make Krazy2 happy.
M +17 -0 smb4kbookmarkobject.cpp
M +16 -0 smb4kbookmarkobject.h
M +2 -2 smb4kmounter.cpp
M +9 -3 smb4kmounter.h
M +1 -1 smb4knetworkobject.cpp
M +0 -1 smb4knetworkobject.h
M +1 -1 smb4kscanner.cpp
M +1 -1 smb4kshare.cpp
--- trunk/playground/network/smb4k/core/smb4kbookmarkobject.cpp #1357342:1357343
@@ -45,6 +45,7 @@
QString label;
QString group;
bool isGroup;
+ bool isMounted;
};
@@ -57,6 +58,7 @@
d->label = bookmark->label();
d->group = bookmark->groupName();
d->isGroup = false;
+ d->isMounted = false;
}
@@ -66,6 +68,7 @@
d->icon = KIcon("folder-favorites");
d->group = groupName;
d->isGroup = true;
+ d->isMounted = false;
}
@@ -74,6 +77,7 @@
: QObject(parent), d( new Smb4KBookmarkObjectPrivate )
{
d->isGroup = false;
+ d->isMounted = false;
}
@@ -191,4 +195,17 @@
}
+bool Smb4KBookmarkObject::isMounted() const
+{
+ return d->isMounted;
+}
+
+
+void Smb4KBookmarkObject::setMounted(bool mounted)
+{
+ d->isMounted = mounted;
+ emit changed();
+}
+
+
#include "smb4kbookmarkobject.moc"
--- trunk/playground/network/smb4k/core/smb4kbookmarkobject.h #1357342:1357343
@@ -66,6 +66,7 @@
Q_PROPERTY( QIcon icon READ icon WRITE setIcon NOTIFY changed )
Q_PROPERTY( QString groupName READ groupName WRITE setGroupName NOTIFY changed )
Q_PROPERTY( bool isGroup READ isGroup WRITE setGroup NOTIFY changed )
+ Q_PROPERTY( bool isMounted READ isMounted WRITE setMounted NOTIFY changed )
public:
/**
@@ -193,6 +194,21 @@
*/
void setGroup( bool group );
+ /**
+ * Returns TRUE if the share that is represented by this bookmark
+ * is mounted.
+ *
+ * @returns TRUE if the bookmarked share is mounted
+ */
+ bool isMounted() const;
+
+ /**
+ * For a share that is mounted set this to TRUE.
+ *
+ * @param mounted Set to TRUE for a mounted share
+ */
+ void setMounted( bool mounted );
+
Q_SIGNALS:
/**
* This signal is emitted if something changed.
--- trunk/playground/network/smb4k/core/smb4kmounter.cpp #1357342:1357343
@@ -769,7 +769,7 @@
}
// 16 times the MAC address
- QStringList parts = options->macAddress().split( ":", QString::SkipEmptyParts );
+ QStringList parts = options->macAddress().split( ':', QString::SkipEmptyParts );
for ( int j = 0; j < 16; ++j )
{
@@ -2318,10 +2318,10 @@
{
d->shareObjects << new Smb4KNetworkObject( mountedSharesList().at( i ) );
}
- }
emit mountedSharesListChanged();
}
+ }
else
{
// Get the host that shares this resource and check if we
--- trunk/playground/network/smb4k/core/smb4kmounter.h #1357342:1357343
@@ -236,7 +236,7 @@
Q_SIGNALS:
/**
* This signal is emitted whenever a share item was updated. This mainly happens
- * from within the import() function.
+ * from within the import process.
*
* @param share The share item that was just updated.
*/
@@ -283,8 +283,14 @@
int process );
/**
- * This signal is emitted every time the list of mounted shares is
- * modified.
+ * This signal is emitted every time a share was added to or removed
+ * from the list of shares. In contrast to the mounted() and unmounted()
+ * signals, this signal is emitted at the end of the modification of
+ * the list (the unmount() signal is emitted before the share is actually
+ * removed from the list).
+ *
+ * If you need to know if the contents of a specific share has been changed,
+ * you need to connect to the updated() signal.
*/
void mountedSharesListChanged();
--- trunk/playground/network/smb4k/core/smb4knetworkobject.cpp #1357342:1357343
@@ -93,7 +93,7 @@
Smb4KNetworkObject::Smb4KNetworkObject( QObject *parent )
: QObject( parent ), d( new Smb4KNetworkObjectPrivate )
{
- d->url = QUrl( "smb://" );
+ d->url.setUrl( "smb://", KUrl::TolerantMode );
d->mounted = false;
d->printer = false;
setType( Network );
--- trunk/playground/network/smb4k/core/smb4knetworkobject.h #1357342:1357343
@@ -58,7 +58,6 @@
class KDE_EXPORT Smb4KNetworkObject : public QObject
{
Q_OBJECT
-
Q_PROPERTY( Type type READ type WRITE setType NOTIFY changed )
Q_PROPERTY( Type parentType READ parentType CONSTANT )
Q_PROPERTY( QString workgroupName READ workgroupName WRITE setWorkgroupName NOTIFY changed )
--- trunk/playground/network/smb4k/core/smb4kscanner.cpp #1357342:1357343
@@ -523,7 +523,7 @@
}
// 16 times the MAC address
- QStringList parts = wol_entries.at( i )->macAddress().split( ":", QString::SkipEmptyParts );
+ QStringList parts = wol_entries.at( i )->macAddress().split( ':', QString::SkipEmptyParts );
for ( int j = 0; j < 16; ++j )
{
--- trunk/playground/network/smb4k/core/smb4kshare.cpp #1357342:1357343
@@ -151,7 +151,7 @@
}
else
{
- d->url.setPath( "/"+name.trimmed() );
+ d->url.setPath( '/'+name.trimmed() );
}
d->url.setProtocol( "smb" );
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic