mirror of
https://git.FreeBSD.org/ports.git
synced 2024-12-25 04:43:33 +00:00
Fix some of the issues in the media:/ kioslave. proc filesystems should no
longer appear in the list, numbering of NFS filesystems should be okay now and removable media should be mountable, unmountable and browseable - if the user running KDE can mount them in the first place (i.e. vfs.usermount and mountpoint ownership still required). Obtained from: KDE SVN
This commit is contained in:
parent
934e321c28
commit
4bdac311d9
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=138993
@ -8,7 +8,7 @@
|
||||
|
||||
PORTNAME= kdebase
|
||||
PORTVERSION= ${KDE_VERSION}
|
||||
PORTREVISION= 1
|
||||
PORTREVISION= 2
|
||||
CATEGORIES= x11 kde
|
||||
MASTER_SITES= ${MASTER_SITE_KDE}
|
||||
MASTER_SITE_SUBDIR= stable/${PORTVERSION:S/.0//}/src
|
||||
|
@ -0,0 +1,63 @@
|
||||
--- kioslave/media/kdedmodule/fstabbackend.cpp
|
||||
+++ kioslave/media/kdedmodule/fstabbackend.cpp
|
||||
@@ -47,6 +47,12 @@
|
||||
handleMtabChange();
|
||||
|
||||
KDirWatch::self()->startScan();
|
||||
+
|
||||
+#ifdef Q_OS_FREEBSD
|
||||
+ connect( &m_mtabTimer, SIGNAL( timeout() ),
|
||||
+ this, SLOT( handleMtabChange() ) );
|
||||
+ m_mtabTimer.start(250);
|
||||
+#endif
|
||||
}
|
||||
|
||||
FstabBackend::~FstabBackend()
|
||||
@@ -86,7 +92,7 @@
|
||||
|| mount->mountType() == "tmpfs"
|
||||
|| mount->mountType() == "sysfs"
|
||||
|| mount->mountType() == "usbfs"
|
||||
- || mount->mountType() == "proc"
|
||||
+ || mount->mountType().contains( "proc" )
|
||||
|| mount->mountType() == "unknown"
|
||||
|| mount->mountType() == "none"
|
||||
|| mount->mountedFrom() == "none"
|
||||
@@ -136,7 +142,7 @@
|
||||
#if 0
|
||||
else if ( !m_mtabIds.contains(id) )
|
||||
{
|
||||
- QString name = generateName(dev);
|
||||
+ QString name = generateName(dev, fs);
|
||||
|
||||
Medium *m = new Medium(id, name);
|
||||
|
||||
@@ -205,7 +211,7 @@
|
||||
|
||||
if ( !m_fstabIds.contains(id) )
|
||||
{
|
||||
- QString name = generateName(dev);
|
||||
+ QString name = generateName(dev, fs);
|
||||
|
||||
Medium *m = new Medium(id, name);
|
||||
|
||||
@@ -247,9 +253,18 @@
|
||||
+m.replace("/", "");
|
||||
}
|
||||
|
||||
-QString FstabBackend::generateName(const QString &devNode)
|
||||
+QString FstabBackend::generateName(const QString &devNode, const QString &fsType)
|
||||
{
|
||||
- return KURL(devNode).fileName();
|
||||
+ KURL url( devNode );
|
||||
+
|
||||
+ if ( url.isValid() )
|
||||
+ {
|
||||
+ return url.fileName();
|
||||
+ }
|
||||
+ else // surely something nfs or samba based
|
||||
+ {
|
||||
+ return fsType;
|
||||
+ }
|
||||
}
|
||||
|
||||
void FstabBackend::guess(const QString &devNode, const QString &mountPoint,
|
@ -0,0 +1,37 @@
|
||||
--- kioslave/media/kdedmodule/fstabbackend.h
|
||||
+++ kioslave/media/kdedmodule/fstabbackend.h
|
||||
@@ -24,6 +24,10 @@
|
||||
#include <qobject.h>
|
||||
#include <qstringlist.h>
|
||||
|
||||
+#ifdef Q_OS_FREEBSD
|
||||
+#include <qtimer.h>
|
||||
+#endif
|
||||
+
|
||||
class FstabBackend : public QObject, public BackendBase
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -38,17 +42,20 @@
|
||||
QString &label);
|
||||
private slots:
|
||||
void slotDirty(const QString &path);
|
||||
-
|
||||
-private:
|
||||
void handleFstabChange();
|
||||
void handleMtabChange();
|
||||
|
||||
+private:
|
||||
static QString generateId(const QString &devNode,
|
||||
const QString &mountPoint);
|
||||
- static QString generateName(const QString &devNode);
|
||||
+ static QString generateName(const QString &devNode,
|
||||
+ const QString &fsType);
|
||||
|
||||
QStringList m_mtabIds;
|
||||
QStringList m_fstabIds;
|
||||
+#ifdef Q_OS_FREEBSD
|
||||
+ QTimer m_mtabTimer;
|
||||
+#endif
|
||||
};
|
||||
|
||||
#endif
|
@ -8,7 +8,7 @@
|
||||
|
||||
PORTNAME= kdebase
|
||||
PORTVERSION= ${KDE_VERSION}
|
||||
PORTREVISION= 1
|
||||
PORTREVISION= 2
|
||||
CATEGORIES= x11 kde
|
||||
MASTER_SITES= ${MASTER_SITE_KDE}
|
||||
MASTER_SITE_SUBDIR= stable/${PORTVERSION:S/.0//}/src
|
||||
|
@ -0,0 +1,63 @@
|
||||
--- kioslave/media/kdedmodule/fstabbackend.cpp
|
||||
+++ kioslave/media/kdedmodule/fstabbackend.cpp
|
||||
@@ -47,6 +47,12 @@
|
||||
handleMtabChange();
|
||||
|
||||
KDirWatch::self()->startScan();
|
||||
+
|
||||
+#ifdef Q_OS_FREEBSD
|
||||
+ connect( &m_mtabTimer, SIGNAL( timeout() ),
|
||||
+ this, SLOT( handleMtabChange() ) );
|
||||
+ m_mtabTimer.start(250);
|
||||
+#endif
|
||||
}
|
||||
|
||||
FstabBackend::~FstabBackend()
|
||||
@@ -86,7 +92,7 @@
|
||||
|| mount->mountType() == "tmpfs"
|
||||
|| mount->mountType() == "sysfs"
|
||||
|| mount->mountType() == "usbfs"
|
||||
- || mount->mountType() == "proc"
|
||||
+ || mount->mountType().contains( "proc" )
|
||||
|| mount->mountType() == "unknown"
|
||||
|| mount->mountType() == "none"
|
||||
|| mount->mountedFrom() == "none"
|
||||
@@ -136,7 +142,7 @@
|
||||
#if 0
|
||||
else if ( !m_mtabIds.contains(id) )
|
||||
{
|
||||
- QString name = generateName(dev);
|
||||
+ QString name = generateName(dev, fs);
|
||||
|
||||
Medium *m = new Medium(id, name);
|
||||
|
||||
@@ -205,7 +211,7 @@
|
||||
|
||||
if ( !m_fstabIds.contains(id) )
|
||||
{
|
||||
- QString name = generateName(dev);
|
||||
+ QString name = generateName(dev, fs);
|
||||
|
||||
Medium *m = new Medium(id, name);
|
||||
|
||||
@@ -247,9 +253,18 @@
|
||||
+m.replace("/", "");
|
||||
}
|
||||
|
||||
-QString FstabBackend::generateName(const QString &devNode)
|
||||
+QString FstabBackend::generateName(const QString &devNode, const QString &fsType)
|
||||
{
|
||||
- return KURL(devNode).fileName();
|
||||
+ KURL url( devNode );
|
||||
+
|
||||
+ if ( url.isValid() )
|
||||
+ {
|
||||
+ return url.fileName();
|
||||
+ }
|
||||
+ else // surely something nfs or samba based
|
||||
+ {
|
||||
+ return fsType;
|
||||
+ }
|
||||
}
|
||||
|
||||
void FstabBackend::guess(const QString &devNode, const QString &mountPoint,
|
@ -0,0 +1,37 @@
|
||||
--- kioslave/media/kdedmodule/fstabbackend.h
|
||||
+++ kioslave/media/kdedmodule/fstabbackend.h
|
||||
@@ -24,6 +24,10 @@
|
||||
#include <qobject.h>
|
||||
#include <qstringlist.h>
|
||||
|
||||
+#ifdef Q_OS_FREEBSD
|
||||
+#include <qtimer.h>
|
||||
+#endif
|
||||
+
|
||||
class FstabBackend : public QObject, public BackendBase
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -38,17 +42,20 @@
|
||||
QString &label);
|
||||
private slots:
|
||||
void slotDirty(const QString &path);
|
||||
-
|
||||
-private:
|
||||
void handleFstabChange();
|
||||
void handleMtabChange();
|
||||
|
||||
+private:
|
||||
static QString generateId(const QString &devNode,
|
||||
const QString &mountPoint);
|
||||
- static QString generateName(const QString &devNode);
|
||||
+ static QString generateName(const QString &devNode,
|
||||
+ const QString &fsType);
|
||||
|
||||
QStringList m_mtabIds;
|
||||
QStringList m_fstabIds;
|
||||
+#ifdef Q_OS_FREEBSD
|
||||
+ QTimer m_mtabTimer;
|
||||
+#endif
|
||||
};
|
||||
|
||||
#endif
|
@ -8,7 +8,7 @@
|
||||
|
||||
PORTNAME= kdebase
|
||||
PORTVERSION= ${KDE_VERSION}
|
||||
PORTREVISION= 1
|
||||
PORTREVISION= 2
|
||||
CATEGORIES= x11 kde
|
||||
MASTER_SITES= ${MASTER_SITE_KDE}
|
||||
MASTER_SITE_SUBDIR= stable/${PORTVERSION:S/.0//}/src
|
||||
|
@ -0,0 +1,63 @@
|
||||
--- kioslave/media/kdedmodule/fstabbackend.cpp
|
||||
+++ kioslave/media/kdedmodule/fstabbackend.cpp
|
||||
@@ -47,6 +47,12 @@
|
||||
handleMtabChange();
|
||||
|
||||
KDirWatch::self()->startScan();
|
||||
+
|
||||
+#ifdef Q_OS_FREEBSD
|
||||
+ connect( &m_mtabTimer, SIGNAL( timeout() ),
|
||||
+ this, SLOT( handleMtabChange() ) );
|
||||
+ m_mtabTimer.start(250);
|
||||
+#endif
|
||||
}
|
||||
|
||||
FstabBackend::~FstabBackend()
|
||||
@@ -86,7 +92,7 @@
|
||||
|| mount->mountType() == "tmpfs"
|
||||
|| mount->mountType() == "sysfs"
|
||||
|| mount->mountType() == "usbfs"
|
||||
- || mount->mountType() == "proc"
|
||||
+ || mount->mountType().contains( "proc" )
|
||||
|| mount->mountType() == "unknown"
|
||||
|| mount->mountType() == "none"
|
||||
|| mount->mountedFrom() == "none"
|
||||
@@ -136,7 +142,7 @@
|
||||
#if 0
|
||||
else if ( !m_mtabIds.contains(id) )
|
||||
{
|
||||
- QString name = generateName(dev);
|
||||
+ QString name = generateName(dev, fs);
|
||||
|
||||
Medium *m = new Medium(id, name);
|
||||
|
||||
@@ -205,7 +211,7 @@
|
||||
|
||||
if ( !m_fstabIds.contains(id) )
|
||||
{
|
||||
- QString name = generateName(dev);
|
||||
+ QString name = generateName(dev, fs);
|
||||
|
||||
Medium *m = new Medium(id, name);
|
||||
|
||||
@@ -247,9 +253,18 @@
|
||||
+m.replace("/", "");
|
||||
}
|
||||
|
||||
-QString FstabBackend::generateName(const QString &devNode)
|
||||
+QString FstabBackend::generateName(const QString &devNode, const QString &fsType)
|
||||
{
|
||||
- return KURL(devNode).fileName();
|
||||
+ KURL url( devNode );
|
||||
+
|
||||
+ if ( url.isValid() )
|
||||
+ {
|
||||
+ return url.fileName();
|
||||
+ }
|
||||
+ else // surely something nfs or samba based
|
||||
+ {
|
||||
+ return fsType;
|
||||
+ }
|
||||
}
|
||||
|
||||
void FstabBackend::guess(const QString &devNode, const QString &mountPoint,
|
@ -0,0 +1,37 @@
|
||||
--- kioslave/media/kdedmodule/fstabbackend.h
|
||||
+++ kioslave/media/kdedmodule/fstabbackend.h
|
||||
@@ -24,6 +24,10 @@
|
||||
#include <qobject.h>
|
||||
#include <qstringlist.h>
|
||||
|
||||
+#ifdef Q_OS_FREEBSD
|
||||
+#include <qtimer.h>
|
||||
+#endif
|
||||
+
|
||||
class FstabBackend : public QObject, public BackendBase
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -38,17 +42,20 @@
|
||||
QString &label);
|
||||
private slots:
|
||||
void slotDirty(const QString &path);
|
||||
-
|
||||
-private:
|
||||
void handleFstabChange();
|
||||
void handleMtabChange();
|
||||
|
||||
+private:
|
||||
static QString generateId(const QString &devNode,
|
||||
const QString &mountPoint);
|
||||
- static QString generateName(const QString &devNode);
|
||||
+ static QString generateName(const QString &devNode,
|
||||
+ const QString &fsType);
|
||||
|
||||
QStringList m_mtabIds;
|
||||
QStringList m_fstabIds;
|
||||
+#ifdef Q_OS_FREEBSD
|
||||
+ QTimer m_mtabTimer;
|
||||
+#endif
|
||||
};
|
||||
|
||||
#endif
|
@ -8,7 +8,7 @@
|
||||
|
||||
PORTNAME= kdebase
|
||||
PORTVERSION= ${KDE_VERSION}
|
||||
PORTREVISION= 1
|
||||
PORTREVISION= 2
|
||||
CATEGORIES= x11 kde
|
||||
MASTER_SITES= ${MASTER_SITE_KDE}
|
||||
MASTER_SITE_SUBDIR= stable/${PORTVERSION:S/.0//}/src
|
||||
|
@ -0,0 +1,63 @@
|
||||
--- kioslave/media/kdedmodule/fstabbackend.cpp
|
||||
+++ kioslave/media/kdedmodule/fstabbackend.cpp
|
||||
@@ -47,6 +47,12 @@
|
||||
handleMtabChange();
|
||||
|
||||
KDirWatch::self()->startScan();
|
||||
+
|
||||
+#ifdef Q_OS_FREEBSD
|
||||
+ connect( &m_mtabTimer, SIGNAL( timeout() ),
|
||||
+ this, SLOT( handleMtabChange() ) );
|
||||
+ m_mtabTimer.start(250);
|
||||
+#endif
|
||||
}
|
||||
|
||||
FstabBackend::~FstabBackend()
|
||||
@@ -86,7 +92,7 @@
|
||||
|| mount->mountType() == "tmpfs"
|
||||
|| mount->mountType() == "sysfs"
|
||||
|| mount->mountType() == "usbfs"
|
||||
- || mount->mountType() == "proc"
|
||||
+ || mount->mountType().contains( "proc" )
|
||||
|| mount->mountType() == "unknown"
|
||||
|| mount->mountType() == "none"
|
||||
|| mount->mountedFrom() == "none"
|
||||
@@ -136,7 +142,7 @@
|
||||
#if 0
|
||||
else if ( !m_mtabIds.contains(id) )
|
||||
{
|
||||
- QString name = generateName(dev);
|
||||
+ QString name = generateName(dev, fs);
|
||||
|
||||
Medium *m = new Medium(id, name);
|
||||
|
||||
@@ -205,7 +211,7 @@
|
||||
|
||||
if ( !m_fstabIds.contains(id) )
|
||||
{
|
||||
- QString name = generateName(dev);
|
||||
+ QString name = generateName(dev, fs);
|
||||
|
||||
Medium *m = new Medium(id, name);
|
||||
|
||||
@@ -247,9 +253,18 @@
|
||||
+m.replace("/", "");
|
||||
}
|
||||
|
||||
-QString FstabBackend::generateName(const QString &devNode)
|
||||
+QString FstabBackend::generateName(const QString &devNode, const QString &fsType)
|
||||
{
|
||||
- return KURL(devNode).fileName();
|
||||
+ KURL url( devNode );
|
||||
+
|
||||
+ if ( url.isValid() )
|
||||
+ {
|
||||
+ return url.fileName();
|
||||
+ }
|
||||
+ else // surely something nfs or samba based
|
||||
+ {
|
||||
+ return fsType;
|
||||
+ }
|
||||
}
|
||||
|
||||
void FstabBackend::guess(const QString &devNode, const QString &mountPoint,
|
@ -0,0 +1,37 @@
|
||||
--- kioslave/media/kdedmodule/fstabbackend.h
|
||||
+++ kioslave/media/kdedmodule/fstabbackend.h
|
||||
@@ -24,6 +24,10 @@
|
||||
#include <qobject.h>
|
||||
#include <qstringlist.h>
|
||||
|
||||
+#ifdef Q_OS_FREEBSD
|
||||
+#include <qtimer.h>
|
||||
+#endif
|
||||
+
|
||||
class FstabBackend : public QObject, public BackendBase
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -38,17 +42,20 @@
|
||||
QString &label);
|
||||
private slots:
|
||||
void slotDirty(const QString &path);
|
||||
-
|
||||
-private:
|
||||
void handleFstabChange();
|
||||
void handleMtabChange();
|
||||
|
||||
+private:
|
||||
static QString generateId(const QString &devNode,
|
||||
const QString &mountPoint);
|
||||
- static QString generateName(const QString &devNode);
|
||||
+ static QString generateName(const QString &devNode,
|
||||
+ const QString &fsType);
|
||||
|
||||
QStringList m_mtabIds;
|
||||
QStringList m_fstabIds;
|
||||
+#ifdef Q_OS_FREEBSD
|
||||
+ QTimer m_mtabTimer;
|
||||
+#endif
|
||||
};
|
||||
|
||||
#endif
|
@ -8,7 +8,7 @@
|
||||
|
||||
PORTNAME= kdebase
|
||||
PORTVERSION= ${KDE_VERSION}
|
||||
PORTREVISION= 1
|
||||
PORTREVISION= 2
|
||||
CATEGORIES= x11 kde
|
||||
MASTER_SITES= ${MASTER_SITE_KDE}
|
||||
MASTER_SITE_SUBDIR= stable/${PORTVERSION:S/.0//}/src
|
||||
|
@ -0,0 +1,63 @@
|
||||
--- kioslave/media/kdedmodule/fstabbackend.cpp
|
||||
+++ kioslave/media/kdedmodule/fstabbackend.cpp
|
||||
@@ -47,6 +47,12 @@
|
||||
handleMtabChange();
|
||||
|
||||
KDirWatch::self()->startScan();
|
||||
+
|
||||
+#ifdef Q_OS_FREEBSD
|
||||
+ connect( &m_mtabTimer, SIGNAL( timeout() ),
|
||||
+ this, SLOT( handleMtabChange() ) );
|
||||
+ m_mtabTimer.start(250);
|
||||
+#endif
|
||||
}
|
||||
|
||||
FstabBackend::~FstabBackend()
|
||||
@@ -86,7 +92,7 @@
|
||||
|| mount->mountType() == "tmpfs"
|
||||
|| mount->mountType() == "sysfs"
|
||||
|| mount->mountType() == "usbfs"
|
||||
- || mount->mountType() == "proc"
|
||||
+ || mount->mountType().contains( "proc" )
|
||||
|| mount->mountType() == "unknown"
|
||||
|| mount->mountType() == "none"
|
||||
|| mount->mountedFrom() == "none"
|
||||
@@ -136,7 +142,7 @@
|
||||
#if 0
|
||||
else if ( !m_mtabIds.contains(id) )
|
||||
{
|
||||
- QString name = generateName(dev);
|
||||
+ QString name = generateName(dev, fs);
|
||||
|
||||
Medium *m = new Medium(id, name);
|
||||
|
||||
@@ -205,7 +211,7 @@
|
||||
|
||||
if ( !m_fstabIds.contains(id) )
|
||||
{
|
||||
- QString name = generateName(dev);
|
||||
+ QString name = generateName(dev, fs);
|
||||
|
||||
Medium *m = new Medium(id, name);
|
||||
|
||||
@@ -247,9 +253,18 @@
|
||||
+m.replace("/", "");
|
||||
}
|
||||
|
||||
-QString FstabBackend::generateName(const QString &devNode)
|
||||
+QString FstabBackend::generateName(const QString &devNode, const QString &fsType)
|
||||
{
|
||||
- return KURL(devNode).fileName();
|
||||
+ KURL url( devNode );
|
||||
+
|
||||
+ if ( url.isValid() )
|
||||
+ {
|
||||
+ return url.fileName();
|
||||
+ }
|
||||
+ else // surely something nfs or samba based
|
||||
+ {
|
||||
+ return fsType;
|
||||
+ }
|
||||
}
|
||||
|
||||
void FstabBackend::guess(const QString &devNode, const QString &mountPoint,
|
@ -0,0 +1,37 @@
|
||||
--- kioslave/media/kdedmodule/fstabbackend.h
|
||||
+++ kioslave/media/kdedmodule/fstabbackend.h
|
||||
@@ -24,6 +24,10 @@
|
||||
#include <qobject.h>
|
||||
#include <qstringlist.h>
|
||||
|
||||
+#ifdef Q_OS_FREEBSD
|
||||
+#include <qtimer.h>
|
||||
+#endif
|
||||
+
|
||||
class FstabBackend : public QObject, public BackendBase
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -38,17 +42,20 @@
|
||||
QString &label);
|
||||
private slots:
|
||||
void slotDirty(const QString &path);
|
||||
-
|
||||
-private:
|
||||
void handleFstabChange();
|
||||
void handleMtabChange();
|
||||
|
||||
+private:
|
||||
static QString generateId(const QString &devNode,
|
||||
const QString &mountPoint);
|
||||
- static QString generateName(const QString &devNode);
|
||||
+ static QString generateName(const QString &devNode,
|
||||
+ const QString &fsType);
|
||||
|
||||
QStringList m_mtabIds;
|
||||
QStringList m_fstabIds;
|
||||
+#ifdef Q_OS_FREEBSD
|
||||
+ QTimer m_mtabTimer;
|
||||
+#endif
|
||||
};
|
||||
|
||||
#endif
|
@ -8,7 +8,7 @@
|
||||
|
||||
PORTNAME= kdebase
|
||||
PORTVERSION= ${KDE_VERSION}
|
||||
PORTREVISION= 1
|
||||
PORTREVISION= 2
|
||||
CATEGORIES= x11 kde
|
||||
MASTER_SITES= ${MASTER_SITE_KDE}
|
||||
MASTER_SITE_SUBDIR= stable/${PORTVERSION:S/.0//}/src
|
||||
|
@ -0,0 +1,63 @@
|
||||
--- kioslave/media/kdedmodule/fstabbackend.cpp
|
||||
+++ kioslave/media/kdedmodule/fstabbackend.cpp
|
||||
@@ -47,6 +47,12 @@
|
||||
handleMtabChange();
|
||||
|
||||
KDirWatch::self()->startScan();
|
||||
+
|
||||
+#ifdef Q_OS_FREEBSD
|
||||
+ connect( &m_mtabTimer, SIGNAL( timeout() ),
|
||||
+ this, SLOT( handleMtabChange() ) );
|
||||
+ m_mtabTimer.start(250);
|
||||
+#endif
|
||||
}
|
||||
|
||||
FstabBackend::~FstabBackend()
|
||||
@@ -86,7 +92,7 @@
|
||||
|| mount->mountType() == "tmpfs"
|
||||
|| mount->mountType() == "sysfs"
|
||||
|| mount->mountType() == "usbfs"
|
||||
- || mount->mountType() == "proc"
|
||||
+ || mount->mountType().contains( "proc" )
|
||||
|| mount->mountType() == "unknown"
|
||||
|| mount->mountType() == "none"
|
||||
|| mount->mountedFrom() == "none"
|
||||
@@ -136,7 +142,7 @@
|
||||
#if 0
|
||||
else if ( !m_mtabIds.contains(id) )
|
||||
{
|
||||
- QString name = generateName(dev);
|
||||
+ QString name = generateName(dev, fs);
|
||||
|
||||
Medium *m = new Medium(id, name);
|
||||
|
||||
@@ -205,7 +211,7 @@
|
||||
|
||||
if ( !m_fstabIds.contains(id) )
|
||||
{
|
||||
- QString name = generateName(dev);
|
||||
+ QString name = generateName(dev, fs);
|
||||
|
||||
Medium *m = new Medium(id, name);
|
||||
|
||||
@@ -247,9 +253,18 @@
|
||||
+m.replace("/", "");
|
||||
}
|
||||
|
||||
-QString FstabBackend::generateName(const QString &devNode)
|
||||
+QString FstabBackend::generateName(const QString &devNode, const QString &fsType)
|
||||
{
|
||||
- return KURL(devNode).fileName();
|
||||
+ KURL url( devNode );
|
||||
+
|
||||
+ if ( url.isValid() )
|
||||
+ {
|
||||
+ return url.fileName();
|
||||
+ }
|
||||
+ else // surely something nfs or samba based
|
||||
+ {
|
||||
+ return fsType;
|
||||
+ }
|
||||
}
|
||||
|
||||
void FstabBackend::guess(const QString &devNode, const QString &mountPoint,
|
@ -0,0 +1,37 @@
|
||||
--- kioslave/media/kdedmodule/fstabbackend.h
|
||||
+++ kioslave/media/kdedmodule/fstabbackend.h
|
||||
@@ -24,6 +24,10 @@
|
||||
#include <qobject.h>
|
||||
#include <qstringlist.h>
|
||||
|
||||
+#ifdef Q_OS_FREEBSD
|
||||
+#include <qtimer.h>
|
||||
+#endif
|
||||
+
|
||||
class FstabBackend : public QObject, public BackendBase
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -38,17 +42,20 @@
|
||||
QString &label);
|
||||
private slots:
|
||||
void slotDirty(const QString &path);
|
||||
-
|
||||
-private:
|
||||
void handleFstabChange();
|
||||
void handleMtabChange();
|
||||
|
||||
+private:
|
||||
static QString generateId(const QString &devNode,
|
||||
const QString &mountPoint);
|
||||
- static QString generateName(const QString &devNode);
|
||||
+ static QString generateName(const QString &devNode,
|
||||
+ const QString &fsType);
|
||||
|
||||
QStringList m_mtabIds;
|
||||
QStringList m_fstabIds;
|
||||
+#ifdef Q_OS_FREEBSD
|
||||
+ QTimer m_mtabTimer;
|
||||
+#endif
|
||||
};
|
||||
|
||||
#endif
|
@ -8,7 +8,7 @@
|
||||
|
||||
PORTNAME= kdebase
|
||||
PORTVERSION= ${KDE_VERSION}
|
||||
PORTREVISION= 1
|
||||
PORTREVISION= 2
|
||||
CATEGORIES= x11 kde
|
||||
MASTER_SITES= ${MASTER_SITE_KDE}
|
||||
MASTER_SITE_SUBDIR= stable/${PORTVERSION:S/.0//}/src
|
||||
|
@ -0,0 +1,63 @@
|
||||
--- kioslave/media/kdedmodule/fstabbackend.cpp
|
||||
+++ kioslave/media/kdedmodule/fstabbackend.cpp
|
||||
@@ -47,6 +47,12 @@
|
||||
handleMtabChange();
|
||||
|
||||
KDirWatch::self()->startScan();
|
||||
+
|
||||
+#ifdef Q_OS_FREEBSD
|
||||
+ connect( &m_mtabTimer, SIGNAL( timeout() ),
|
||||
+ this, SLOT( handleMtabChange() ) );
|
||||
+ m_mtabTimer.start(250);
|
||||
+#endif
|
||||
}
|
||||
|
||||
FstabBackend::~FstabBackend()
|
||||
@@ -86,7 +92,7 @@
|
||||
|| mount->mountType() == "tmpfs"
|
||||
|| mount->mountType() == "sysfs"
|
||||
|| mount->mountType() == "usbfs"
|
||||
- || mount->mountType() == "proc"
|
||||
+ || mount->mountType().contains( "proc" )
|
||||
|| mount->mountType() == "unknown"
|
||||
|| mount->mountType() == "none"
|
||||
|| mount->mountedFrom() == "none"
|
||||
@@ -136,7 +142,7 @@
|
||||
#if 0
|
||||
else if ( !m_mtabIds.contains(id) )
|
||||
{
|
||||
- QString name = generateName(dev);
|
||||
+ QString name = generateName(dev, fs);
|
||||
|
||||
Medium *m = new Medium(id, name);
|
||||
|
||||
@@ -205,7 +211,7 @@
|
||||
|
||||
if ( !m_fstabIds.contains(id) )
|
||||
{
|
||||
- QString name = generateName(dev);
|
||||
+ QString name = generateName(dev, fs);
|
||||
|
||||
Medium *m = new Medium(id, name);
|
||||
|
||||
@@ -247,9 +253,18 @@
|
||||
+m.replace("/", "");
|
||||
}
|
||||
|
||||
-QString FstabBackend::generateName(const QString &devNode)
|
||||
+QString FstabBackend::generateName(const QString &devNode, const QString &fsType)
|
||||
{
|
||||
- return KURL(devNode).fileName();
|
||||
+ KURL url( devNode );
|
||||
+
|
||||
+ if ( url.isValid() )
|
||||
+ {
|
||||
+ return url.fileName();
|
||||
+ }
|
||||
+ else // surely something nfs or samba based
|
||||
+ {
|
||||
+ return fsType;
|
||||
+ }
|
||||
}
|
||||
|
||||
void FstabBackend::guess(const QString &devNode, const QString &mountPoint,
|
@ -0,0 +1,37 @@
|
||||
--- kioslave/media/kdedmodule/fstabbackend.h
|
||||
+++ kioslave/media/kdedmodule/fstabbackend.h
|
||||
@@ -24,6 +24,10 @@
|
||||
#include <qobject.h>
|
||||
#include <qstringlist.h>
|
||||
|
||||
+#ifdef Q_OS_FREEBSD
|
||||
+#include <qtimer.h>
|
||||
+#endif
|
||||
+
|
||||
class FstabBackend : public QObject, public BackendBase
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -38,17 +42,20 @@
|
||||
QString &label);
|
||||
private slots:
|
||||
void slotDirty(const QString &path);
|
||||
-
|
||||
-private:
|
||||
void handleFstabChange();
|
||||
void handleMtabChange();
|
||||
|
||||
+private:
|
||||
static QString generateId(const QString &devNode,
|
||||
const QString &mountPoint);
|
||||
- static QString generateName(const QString &devNode);
|
||||
+ static QString generateName(const QString &devNode,
|
||||
+ const QString &fsType);
|
||||
|
||||
QStringList m_mtabIds;
|
||||
QStringList m_fstabIds;
|
||||
+#ifdef Q_OS_FREEBSD
|
||||
+ QTimer m_mtabTimer;
|
||||
+#endif
|
||||
};
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue
Block a user