View | Details | Raw Unified | Return to bug 169795
Collapse All | Expand All

(-)./Makefile (-2 / +1 lines)
Lines 6-13 Link Here
6
#
6
#
7
7
8
PORTNAME=	qtfm
8
PORTNAME=	qtfm
9
DISTVERSION=	5.4
9
DISTVERSION=	5.5
10
PORTREVISION=	1
11
CATEGORIES=	x11-fm
10
CATEGORIES=	x11-fm
12
MASTER_SITES=	http://www.qtfm.org/
11
MASTER_SITES=	http://www.qtfm.org/
13
12
(-)./distinfo (-2 / +2 lines)
Lines 1-2 Link Here
1
SHA256 (qtfm-5.4.tar.gz) = 8ef4c2464502959944e1b2476aa635b2a889d2859ba62dd61d8f591779c6fd0d
1
SHA256 (qtfm-5.5.tar.gz) = 845fc43800d12483fa1993c56a8c965ff8dc917b97f03d9ce2e24318806fb211
2
SIZE (qtfm-5.4.tar.gz) = 147293
2
SIZE (qtfm-5.5.tar.gz) = 149667
(-)./files/patch-src_bookmarks.cpp (-4 / +6 lines)
Lines 1-5 Link Here
1
--- src/bookmarks.cpp.orig	2012-03-08 04:46:39.000000000 -0600
1
--- src/bookmarks.cpp.orig	2012-07-11 18:10:56.065528820 -0500
2
+++ src/bookmarks.cpp	2012-04-30 14:20:26.157046128 -0500
2
+++ src/bookmarks.cpp	2012-07-11 18:19:42.041677562 -0500
3
@@ -22,6 +22,11 @@
3
@@ -22,6 +22,11 @@
4
 #ifndef BOOKMARKS_CPP
4
 #ifndef BOOKMARKS_CPP
5
 #define BOOKMARKS_CPP
5
 #define BOOKMARKS_CPP
Lines 12-18 Link Here
12
 #include <QtGui>
12
 #include <QtGui>
13
 #include "bookmarkmodel.h"
13
 #include "bookmarkmodel.h"
14
 #include "icondlg.h"
14
 #include "icondlg.h"
15
@@ -80,42 +85,74 @@ void MainWindow::mountWatcherTriggered()
15
@@ -80,44 +85,74 @@ void MainWindow::mountWatcherTriggered()
16
 }
16
 }
17
 
17
 
18
 //---------------------------------------------------------------------------
18
 //---------------------------------------------------------------------------
Lines 74-84 Link Here
74
-    mtab.close();
74
-    mtab.close();
75
+    mntsize = getmntinfo(&mntbuf, MNT_NOWAIT);
75
+    mntsize = getmntinfo(&mntbuf, MNT_NOWAIT);
76
 
76
 
77
-    QStringList sysMounts = QStringList() << "/dev" << "/sys" << "/pro" << "/tmp" << "/run";
77
     QStringList dontShowList = settings->value("hideBookmarks",0).toStringList();
78
     QStringList dontShowList = settings->value("hideBookmarks",0).toStringList();
78
     mounts.clear();
79
     mounts.clear();
79
 
80
 
80
-    foreach(QString item, mtabMounts)
81
-    foreach(QString item, mtabMounts)
81
-        if(item[0] == '/')
82
-	if(!sysMounts.contains(item.split(" ").at(1).left(4)))
82
+    for (mnt = mntbuf; mntsize > 0; mntsize--, mnt++)
83
+    for (mnt = mntbuf; mntsize > 0; mntsize--, mnt++)
83
+        // XXX zpool name does not start with /
84
+        // XXX zpool name does not start with /
84
+        if (mnt->f_mntfromname[0] == '/' or !strcmp(mnt->f_fstypename, "zfs"))
85
+        if (mnt->f_mntfromname[0] == '/' or !strcmp(mnt->f_fstypename, "zfs"))
Lines 94-99 Link Here
94
+                //add a new auto bookmark if it doesn't exist
95
+                //add a new auto bookmark if it doesn't exist
95
+                if(!autoBookmarks.contains(mnt->f_mntonname))
96
+                if(!autoBookmarks.contains(mnt->f_mntonname))
96
                 {
97
                 {
98
-			autoBookmarks.append(path);
97
-                    if(item.split(" ").at(2) == "iso9660") modelBookmarks->addBookmark(path,path,"1","drive-optical");
99
-                    if(item.split(" ").at(2) == "iso9660") modelBookmarks->addBookmark(path,path,"1","drive-optical");
98
-                    else if(item.split(" ").at(2).contains("fat")) modelBookmarks->addBookmark(path,path,"1","drive-removable-media");
100
-                    else if(item.split(" ").at(2).contains("fat")) modelBookmarks->addBookmark(path,path,"1","drive-removable-media");
99
-                    else modelBookmarks->addBookmark(path,path,"1","drive-harddisk");
101
-                    else modelBookmarks->addBookmark(path,path,"1","drive-harddisk");
(-)./files/patch-src_mymodel.cpp (-32 / +67 lines)
Lines 1-5 Link Here
1
--- src/mymodel.cpp.orig	2012-03-09 05:00:54.000000000 -0600
1
--- src/mymodel.cpp.orig	2012-07-11 18:21:24.302333223 -0500
2
+++ src/mymodel.cpp	2012-04-29 16:13:57.725169164 -0500
2
+++ src/mymodel.cpp	2012-07-11 18:59:06.428956406 -0500
3
@@ -21,7 +21,6 @@
3
@@ -21,7 +21,6 @@
4
 
4
 
5
 #include <mainwindow.h>
5
 #include <mainwindow.h>
Lines 8-26 Link Here
8
 #include <unistd.h>
8
 #include <unistd.h>
9
 #include <sys/ioctl.h>
9
 #include <sys/ioctl.h>
10
 
10
 
11
@@ -63,9 +62,8 @@ myModel::myModel(bool realMime)
11
@@ -63,10 +62,8 @@ myModel::myModel(bool realMime)
12
 
12
 
13
     iconFactory = new QFileIconProvider();
13
     iconFactory = new QFileIconProvider();
14
 
14
 
15
-    inotifyFD = inotify_init();
15
-    inotifyFD = inotify_init();
16
-    notifier = new QSocketNotifier(inotifyFD, QSocketNotifier::Read, this);
16
-    notifier = new QSocketNotifier(inotifyFD, QSocketNotifier::Read, this);
17
-    connect(notifier, SIGNAL(activated(int)), this, SLOT(notifyChange()));
17
-    connect(notifier, SIGNAL(activated(int)), this, SLOT(notifyChange()));
18
-    connect(&eventTimer,SIGNAL(timeout()),this,SLOT(eventTimeout()));
18
+    watcher = new QFileSystemWatcher(this);
19
+    watcher = new QFileSystemWatcher(this);
19
+    connect(watcher, SIGNAL(directoryChanged(QString)), this, SLOT(notifyChange(QString)));
20
+    connect(watcher, SIGNAL(directoryChanged(QString)), this, SLOT(notifyChange(QString)));
20
 
21
 
21
     realMimeTypes = realMime;
22
     realMimeTypes = realMime;
22
 }
23
 }
23
@@ -188,28 +186,9 @@ QString myModel::getMimeType(const QMode
24
@@ -189,62 +186,9 @@ QString myModel::getMimeType(const QMode
24
 }
25
 }
25
 
26
 
26
 //---------------------------------------------------------------------------------------
27
 //---------------------------------------------------------------------------------------
Lines 44-81 Link Here
44
-
45
-
45
-        int w = event->wd;
46
-        int w = event->wd;
46
-
47
-
47
-        if(watchers.contains(w))
48
-        if(eventTimer.isActive())
48
-        {
49
-        {
49
-            myModelItem *parent = rootItem->matchPath(watchers.value(w).split(SEPARATOR));
50
-            if(w == lastEventID)
50
+            myModelItem *parent = rootItem->matchPath(path.split(SEPARATOR));
51
-                eventTimer.start(40);
51
 
52
-            else
52
             if(parent)
53
-            {
53
             {
54
-                eventTimer.stop();
54
@@ -230,9 +209,7 @@ void myModel::notifyChange()
55
-                notifyProcess(lastEventID);
55
                         //must of been deleted, remove from model
56
-                lastEventID = w;
56
                         if(child->fileInfo().isDir())
57
-                eventTimer.start(40);
57
                         {
58
-            }
58
-                            int wd = watchers.key(child->absoluteFilePath());
59
-        }
59
-                            inotify_rm_watch(inotifyFD,wd);
60
-        else
60
-                            watchers.remove(wd);
61
-        {
61
+                            watcher->removePath(child->absoluteFilePath());
62
-            lastEventID = w;
62
                         }
63
-            eventTimer.start(40);
63
                         beginRemoveRows(index(parent->absoluteFilePath()),child->childNumber(),child->childNumber());
64
                         parent->removeChild(child);
65
@@ -249,23 +226,17 @@ void myModel::notifyChange()
66
             }
67
             else
68
             {
69
-                inotify_rm_watch(inotifyFD,w);
70
-                watchers.remove(w);
71
+                watcher->removePath(path);
72
             }
73
-        }
64
-        }
74
-
65
-
75
-        at += sizeof(inotify_event) + event->len;
66
-        at += sizeof(inotify_event) + event->len;
76
-    }
67
-    }
77
-
68
-
78
-    notifier->setEnabled(1);
69
-    notifier->setEnabled(1);
70
-}
71
-
72
-//---------------------------------------------------------------------------------------
73
-void myModel::eventTimeout()
74
-{
75
-    notifyProcess(lastEventID);
76
-    eventTimer.stop();
77
-}
78
-
79
-//---------------------------------------------------------------------------------------
80
-void myModel::notifyProcess(int eventID)
81
-{
82
-    if(watchers.contains(eventID))
83
-    {
84
-        myModelItem *parent = rootItem->matchPath(watchers.value(eventID).split(SEPARATOR));
85
+        myModelItem *parent = rootItem->matchPath(path.split(SEPARATOR));
86
 
87
         if(parent)
88
         {
89
@@ -265,9 +209,7 @@ void myModel::notifyProcess(int eventID)
90
                     //must of been deleted, remove from model
91
                     if(child->fileInfo().isDir())
92
                     {
93
-                        int wd = watchers.key(child->absoluteFilePath());
94
-                        inotify_rm_watch(inotifyFD,wd);
95
-                        watchers.remove(wd);
96
+                        watcher->removePath(child->absoluteFilePath());
97
                     }
98
                     beginRemoveRows(index(parent->absoluteFilePath()),child->childNumber(),child->childNumber());
99
                     parent->removeChild(child);
100
@@ -282,20 +224,19 @@ void myModel::notifyProcess(int eventID)
101
                 endInsertRows();
102
             }
103
         }
104
-    }
105
-    else
106
-    {
107
-        inotify_rm_watch(inotifyFD,eventID);
108
-        watchers.remove(eventID);
109
-    }
110
+        else
111
+        {
112
+                watcher->removePath(path);
113
+        }
79
 }
114
 }
80
 
115
 
81
 //---------------------------------------------------------------------------------
116
 //---------------------------------------------------------------------------------
Lines 90-96 Link Here
90
         item->watched = 1;
125
         item->watched = 1;
91
         item = item->parent();
126
         item = item->parent();
92
     }
127
     }
93
@@ -278,7 +249,7 @@ bool myModel::setRootPath(const QString&
128
@@ -308,7 +249,7 @@ bool myModel::setRootPath(const QString&
94
 
129
 
95
     myModelItem *item = rootItem->matchPath(path.split(SEPARATOR));
130
     myModelItem *item = rootItem->matchPath(path.split(SEPARATOR));
96
 
131
 
Lines 99-105 Link Here
99
 
134
 
100
     if(item->walked == 0)
135
     if(item->walked == 0)
101
     {
136
     {
102
@@ -352,10 +323,7 @@ void myModel::refresh()
137
@@ -382,10 +323,7 @@ void myModel::refresh()
103
 {
138
 {
104
     myModelItem *item = rootItem->matchPath(QStringList("/"));
139
     myModelItem *item = rootItem->matchPath(QStringList("/"));
105
 
140
 
Lines 111-117 Link Here
111
 
146
 
112
     beginResetModel();
147
     beginResetModel();
113
     item->clearAll();
148
     item->clearAll();
114
@@ -811,9 +779,7 @@ bool myModel::remove(const QModelIndex &
149
@@ -840,9 +778,7 @@ bool myModel::remove(const QModelIndex &
115
         QFileInfo info(children.at(i));
150
         QFileInfo info(children.at(i));
116
         if(info.isDir())
151
         if(info.isDir())
117
         {
152
         {
(-)./files/patch-src_mymodel.h (-4 / +8 lines)
Lines 1-23 Link Here
1
--- src/mymodel.h.orig	2012-03-09 00:47:45.000000000 -0600
1
--- src/mymodel.h.orig	2012-07-11 19:01:59.919235618 -0500
2
+++ src/mymodel.h	2012-04-29 13:59:45.508571462 -0500
2
+++ src/mymodel.h	2012-07-11 19:03:41.246365243 -0500
3
@@ -83,8 +83,8 @@ public:
3
@@ -84,10 +84,8 @@ public:
4
         bool realMimeTypes;
4
         bool realMimeTypes;
5
 
5
 
6
 public slots:
6
 public slots:
7
-        void notifyChange();
7
-        void notifyChange();
8
-        void notifyProcess(int eventID);
9
-        void eventTimeout();
8
-        void addWatcher(myModelItem* path);
10
-        void addWatcher(myModelItem* path);
9
+        void notifyChange(QString const& path);
11
+        void notifyChange(QString const& path);
10
+        void addToWatcher(myModelItem* path);
12
+        void addToWatcher(myModelItem* path);
11
 
13
 
12
 signals:
14
 signals:
13
         void dragDropPaste(const QMimeData * data, QString newPath, QStringList cutList);
15
         void dragDropPaste(const QMimeData * data, QString newPath, QStringList cutList);
14
@@ -113,9 +113,7 @@ private:
16
@@ -116,11 +114,7 @@ private:
15
         QString currentRootPath;
17
         QString currentRootPath;
16
         QFileIconProvider* iconFactory;
18
         QFileIconProvider* iconFactory;
17
 
19
 
18
-        int inotifyFD;
20
-        int inotifyFD;
19
-        QSocketNotifier *notifier;
21
-        QSocketNotifier *notifier;
20
-        QHash<int, QString> watchers;
22
-        QHash<int, QString> watchers;
23
-        QTimer eventTimer;
24
-        int lastEventID;
21
+        QFileSystemWatcher *watcher;
25
+        QFileSystemWatcher *watcher;
22
 };
26
 };
23
 
27
 
(-)./pkg-plist (+1 lines)
Lines 9-14 Link Here
9
%%DATADIR%%/qtfm_pl.qm
9
%%DATADIR%%/qtfm_pl.qm
10
%%DATADIR%%/qtfm_ru.qm
10
%%DATADIR%%/qtfm_ru.qm
11
%%DATADIR%%/qtfm_sr.qm
11
%%DATADIR%%/qtfm_sr.qm
12
%%DATADIR%%/qtfm_sv.qm
12
%%DATADIR%%/qtfm_zh.qm
13
%%DATADIR%%/qtfm_zh.qm
13
%%DATADIR%%/qtfm_zh_TW.qm
14
%%DATADIR%%/qtfm_zh_TW.qm
14
@dirrm %%DATADIR%%
15
@dirrm %%DATADIR%%

Return to bug 169795