From owner-svn-ports-head@freebsd.org Wed Jul 4 09:30:57 2018 Return-Path: Delivered-To: svn-ports-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7CEB61016FBA; Wed, 4 Jul 2018 09:30:57 +0000 (UTC) (envelope-from adridg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3193070770; Wed, 4 Jul 2018 09:30:57 +0000 (UTC) (envelope-from adridg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 12CF11017; Wed, 4 Jul 2018 09:30:57 +0000 (UTC) (envelope-from adridg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w649UuRH080442; Wed, 4 Jul 2018 09:30:56 GMT (envelope-from adridg@FreeBSD.org) Received: (from adridg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w649UuUY080441; Wed, 4 Jul 2018 09:30:56 GMT (envelope-from adridg@FreeBSD.org) Message-Id: <201807040930.w649UuUY080441@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adridg set sender to adridg@FreeBSD.org using -f From: Adriaan de Groot Date: Wed, 4 Jul 2018 09:30:56 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r473874 - head/x11-fm/qtfm/files X-SVN-Group: ports-head X-SVN-Commit-Author: adridg X-SVN-Commit-Paths: head/x11-fm/qtfm/files X-SVN-Commit-Revision: 473874 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jul 2018 09:30:57 -0000 Author: adridg Date: Wed Jul 4 09:30:56 2018 New Revision: 473874 URL: https://svnweb.freebsd.org/changeset/ports/473874 Log: x11-wm/qtfm Fix build with Clang6 mymodel.cpp:166:12: error: no viable conversion from returned value of type 'bool' to function return type 'QString' Presumably, false -> 0 -> NULL -> QString(char *) was at some point a viable conversion. Return an empty QString explicitly. Reported by: linimon Modified: head/x11-fm/qtfm/files/patch-src_mymodel.cpp Modified: head/x11-fm/qtfm/files/patch-src_mymodel.cpp ============================================================================== --- head/x11-fm/qtfm/files/patch-src_mymodel.cpp Wed Jul 4 09:20:14 2018 (r473873) +++ head/x11-fm/qtfm/files/patch-src_mymodel.cpp Wed Jul 4 09:30:56 2018 (r473874) @@ -1,159 +1,11 @@ ---- src/mymodel.cpp.orig 2012-07-11 18:21:24.302333223 -0500 -+++ src/mymodel.cpp 2012-07-11 18:59:06.428956406 -0500 -@@ -21,7 +21,6 @@ +--- src/mymodel.cpp.orig 2018-07-04 09:21:07 UTC ++++ src/mymodel.cpp +@@ -166,7 +166,7 @@ QString myModel::filePath(const QModelIn - #include - #include "mymodel.h" --#include - #include - #include + if(item) return item->absoluteFilePath(); -@@ -63,10 +62,8 @@ myModel::myModel(bool realMime) - - iconFactory = new QFileIconProvider(); - -- inotifyFD = inotify_init(); -- notifier = new QSocketNotifier(inotifyFD, QSocketNotifier::Read, this); -- connect(notifier, SIGNAL(activated(int)), this, SLOT(notifyChange())); -- connect(&eventTimer,SIGNAL(timeout()),this,SLOT(eventTimeout())); -+ watcher = new QFileSystemWatcher(this); -+ connect(watcher, SIGNAL(directoryChanged(QString)), this, SLOT(notifyChange(QString))); - - realMimeTypes = realMime; +- return false; ++ return QString(); } -@@ -189,62 +186,9 @@ QString myModel::getMimeType(const QMode - } //--------------------------------------------------------------------------------------- --void myModel::notifyChange() -+void myModel::notifyChange(QString const& path) - { -- notifier->setEnabled(0); -- -- int buffSize = 0; -- ioctl(inotifyFD, FIONREAD, (char *) &buffSize); -- -- QByteArray buffer; -- buffer.resize(buffSize); -- read(inotifyFD,buffer.data(),buffSize); -- const char *at = buffer.data(); -- const char * const end = at + buffSize; -- -- while (at < end) -- { -- const inotify_event *event = reinterpret_cast(at); -- -- int w = event->wd; -- -- if(eventTimer.isActive()) -- { -- if(w == lastEventID) -- eventTimer.start(40); -- else -- { -- eventTimer.stop(); -- notifyProcess(lastEventID); -- lastEventID = w; -- eventTimer.start(40); -- } -- } -- else -- { -- lastEventID = w; -- eventTimer.start(40); -- } -- -- at += sizeof(inotify_event) + event->len; -- } -- -- notifier->setEnabled(1); --} -- --//--------------------------------------------------------------------------------------- --void myModel::eventTimeout() --{ -- notifyProcess(lastEventID); -- eventTimer.stop(); --} -- --//--------------------------------------------------------------------------------------- --void myModel::notifyProcess(int eventID) --{ -- if(watchers.contains(eventID)) -- { -- myModelItem *parent = rootItem->matchPath(watchers.value(eventID).split(SEPARATOR)); -+ myModelItem *parent = rootItem->matchPath(path.split(SEPARATOR)); - - if(parent) - { -@@ -265,9 +209,7 @@ void myModel::notifyProcess(int eventID) - //must of been deleted, remove from model - if(child->fileInfo().isDir()) - { -- int wd = watchers.key(child->absoluteFilePath()); -- inotify_rm_watch(inotifyFD,wd); -- watchers.remove(wd); -+ watcher->removePath(child->absoluteFilePath()); - } - beginRemoveRows(index(parent->absoluteFilePath()),child->childNumber(),child->childNumber()); - parent->removeChild(child); -@@ -282,20 +224,19 @@ void myModel::notifyProcess(int eventID) - endInsertRows(); - } - } -- } -- else -- { -- inotify_rm_watch(inotifyFD,eventID); -- watchers.remove(eventID); -- } -+ else -+ { -+ watcher->removePath(path); -+ } - } - - //--------------------------------------------------------------------------------- --void myModel::addWatcher(myModelItem *item) -+void myModel::addToWatcher(myModelItem *item) - { - while(item != rootItem) - { -- watchers.insert(inotify_add_watch(inotifyFD, item->absoluteFilePath().toLocal8Bit(), IN_MOVE | IN_CREATE | IN_DELETE),item->absoluteFilePath()); //IN_ONESHOT | IN_ALL_EVENTS) -+ if (!watcher->directories().contains(item->absoluteFilePath())) -+ watcher->addPath(item->absoluteFilePath()); - item->watched = 1; - item = item->parent(); - } -@@ -308,7 +249,7 @@ bool myModel::setRootPath(const QString& - - myModelItem *item = rootItem->matchPath(path.split(SEPARATOR)); - -- if(item->watched == 0) addWatcher(item); -+ if(item->watched == 0) addToWatcher(item); - - if(item->walked == 0) - { -@@ -382,10 +323,7 @@ void myModel::refresh() - { - myModelItem *item = rootItem->matchPath(QStringList("/")); - -- //free all inotify watches -- foreach(int w, watchers.keys()) -- inotify_rm_watch(inotifyFD,w); -- watchers.clear(); -+ watcher->removePaths(watcher->directories()); - - beginResetModel(); - item->clearAll(); -@@ -840,9 +778,7 @@ bool myModel::remove(const QModelIndex & - QFileInfo info(children.at(i)); - if(info.isDir()) - { -- int wd = watchers.key(info.filePath()); -- inotify_rm_watch(inotifyFD,wd); -- watchers.remove(wd); -+ watcher->removePath(info.filePath()); - error |= QDir().rmdir(info.filePath()); - } - else error |= QFile::remove(info.filePath());