<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[QFilehandle required for client-server text app.]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">I want to make Calligra use a client-server model when it comes to the documents.</p>
<p dir="auto">I'm working on software (OSNS) which offers developers the possibility to write code which makes use of a fd to a remote document (for example) via SSH. It's possible to connect to a ssh subsystem (well known is sftp) like a document server.<br />
This way it is possible to have a client (the UI) on the workstation, while you the document is on server, which gives you to be independent of the computer/workstation, which is very nice. It also makes possible to work on a document with more than one. (a locking scheme is required though).</p>
<p dir="auto">Now Calligra looks abandonned.<br />
But to make it work a QFilehandle is required. This Qt implementation is required for the client to "talk" to the server. Since client and server maybe on different machines, the  normal fd or Qfile is useless.</p>
<p dir="auto">I do not see a QFilehandle class, but messages about the need for it though.</p>
<p dir="auto">What do you think? Do I have to add iit myself?</p>
<p dir="auto">Stef Bon</p>
]]></description><link>https://forum.qt.io/topic/164976/qfilehandle-required-for-client-server-text-app.</link><generator>RSS for Node</generator><lastBuildDate>Tue, 01 Sep 2026 15:45:17 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/164976.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 06 Aug 2026 14:27:44 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to QFilehandle required for client-server text app. on Tue, 11 Aug 2026 06:40:09 GMT]]></title><description><![CDATA[<p dir="auto">I would say that Microsoft Word has already established what users expect when editing files together: You see all changes happening immediately together with a colored cursor for each user with a tag of their name. And those cursors move around live. The best thing is that you can follow where other users are currently editing the document and you'll most likely avoid editing the same thing.</p>
<p dir="auto">This usually requires for your documents to live in a "cloud" (even if the cloud is your own private cloud at home) and a server that at least tracks all concurrent users of the document and tells each user about the others.</p>
<p dir="auto">The best example of what it should have been like is Google Wave (unfortunately, this project has been shut down after only a few years). It was based on XMPP for realtime communication.</p>
]]></description><link>https://forum.qt.io/post/839649</link><guid isPermaLink="true">https://forum.qt.io/post/839649</guid><dc:creator><![CDATA[SimonSchroeder]]></dc:creator><pubDate>Tue, 11 Aug 2026 06:40:09 GMT</pubDate></item><item><title><![CDATA[Reply to QFilehandle required for client-server text app. on Mon, 10 Aug 2026 12:56:31 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/stefbon">@<bdi>stefbon</bdi></a> said in <a href="/post/839629">QFilehandle required for client-server text app.</a>:</p>
<blockquote>
<p dir="auto">Every paragrap has it's own record in a database, so it's easy to achieve the desired locking: everyone can edit (=write to ) a paragraph, unless someone else is already doing that. And inserting, changing and deleting a paragraph is easy to maintain by a server.</p>
</blockquote>
<p dir="auto">It's not going to be as simple as that in your real-world situation.</p>
<p dir="auto">You are describing <em>pessimistic locking</em>.  You are going to require each user to do something before they can edit or delete a paragraph to "lock" it.  What are you going to do if the locker then goes to lunch, or never returns?  Having a pessimistic lock held for a long time is a pita.</p>
<p dir="auto">Alternative is <em>optimistic</em> locking.  No "blocking" lock held.  You save state of paragraph when user starts to edit.  When ready to submit changes you make it <code>UPDATE ... SET paragraph = new_paragraph  WHERE paragraph = old_paragraph</code>.  This ensures update is committed only when nobody else has changed paragraph while you were editing.  Often better for sharing.  But you still have to deal with what to do if someone else <em>has</em> changed it while you were editing.  Usual is to throw away new change and make user redo from newly changed paragraph state.  Not so bad for "little records", not so good for "paragraphs".</p>
<p dir="auto">Then you have inserts.  Between two existing paragraphs you &amp; I each decide we want to insert our own new paragraph.  There is nothing to lock or compare.  Which order do you place these two paragraphs after we each submit?  Perhaps "first (based on submit time) submitter's paragraph is inserted and then second submitter's paragraph is inserted after first one" (or other way round).  But maybe first inserter's paragraph has to go <em>before</em> the old paragraph <em>after</em> it and second inserter's paragraph has to go <em>after</em> the old paragraph which was <em>before</em> it.  they are now the wrong way round.</p>
<p dir="auto">And a whole host of other similars.  It's one thing handling contention on small rows/columns, it's another on documents.  Not to mention stuff like your interface may have to "push" changes from one user into another user's session while they are middle of doing something/their own editing.  I foresee many problems....</p>
]]></description><link>https://forum.qt.io/post/839631</link><guid isPermaLink="true">https://forum.qt.io/post/839631</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Mon, 10 Aug 2026 12:56:31 GMT</pubDate></item><item><title><![CDATA[Reply to QFilehandle required for client-server text app. on Mon, 10 Aug 2026 10:51:35 GMT]]></title><description><![CDATA[<p dir="auto">Last post before I start another topic how to solve this. I think that the classic idea of a file (and a filedescriptor) does not work with collborative editing. I think that a document is not a file anymore, but a group of ordered paragraps. Every paragrap has it's own record in a database, so it's easy to achieve the desired locking: everyone can edit (=write to )  a paragraph, unless someone else is already doing that. And inserting, changing and deleting a paragraph is easy to maintain by a server.</p>
<p dir="auto">So internally a document is not a file anymore, but a group of ordered paragraphs.<br />
A paragraph is a piece of text, but also an image, an inserted piece of another langauge (R for example).</p>
<p dir="auto">To have a file you need a goord export function (to ODT and PDF).,</p>
<p dir="auto">Stef</p>
]]></description><link>https://forum.qt.io/post/839629</link><guid isPermaLink="true">https://forum.qt.io/post/839629</guid><dc:creator><![CDATA[stefbon]]></dc:creator><pubDate>Mon, 10 Aug 2026 10:51:35 GMT</pubDate></item><item><title><![CDATA[Reply to QFilehandle required for client-server text app. on Fri, 07 Aug 2026 16:34:13 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jonb">@<bdi>JonB</bdi></a> and others</p>
<p dir="auto">you are absolutely right. When inserting text in a normal file the synchronisation is a challenge.<br />
I have to think that over. Every user has it's own window to a document. And synchronisation is only required when another user's window "reaches" the text you've inserted/changed.</p>
<p dir="auto">Lot's of work.</p>
<p dir="auto">Thanks,</p>
<p dir="auto">Stef Bon<br />
the Netherlands</p>
]]></description><link>https://forum.qt.io/post/839596</link><guid isPermaLink="true">https://forum.qt.io/post/839596</guid><dc:creator><![CDATA[stefbon]]></dc:creator><pubDate>Fri, 07 Aug 2026 16:34:13 GMT</pubDate></item><item><title><![CDATA[Reply to QFilehandle required for client-server text app. on Fri, 07 Aug 2026 06:53:00 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/stefbon">@<bdi>stefbon</bdi></a><br />
If you appear to have a "working" <code>fd</code> which does what you want and you then want a <code>QFile</code> wrapper for a Qt program then as I said earlier you could use that <code>QFile::open()</code> overload.</p>
<p dir="auto">File byte range locking is only of use in a database-type file which is accessed directly from clients, not client-server with a central server.</p>
<p dir="auto">I am not aware of any means of seeing an "event" like someone else "starting to edit the file", however you might define that.  The closest is Qt's <a href="https://doc.qt.io/qt-6/qfilesystemwatcher.html" target="_blank" rel="noopener noreferrer nofollow ugc">QFileSystemWatcher Class</a>, but it doesn't achieve that.</p>
<p dir="auto">Most important is: any solution involving Qt classes the way you want would only at best work if everyone goes through Qt/your code.  Assuming you want to allow for non-Qt access from other programs you would need to work at the <code>fd</code> level.  Qt does not do anything in <code>QFile</code> etc. which you could not do yourself.  And any approach is liable to be platform-dependent and depend on what low-level facilities each platform offers.</p>
]]></description><link>https://forum.qt.io/post/839575</link><guid isPermaLink="true">https://forum.qt.io/post/839575</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Fri, 07 Aug 2026 06:53:00 GMT</pubDate></item><item><title><![CDATA[Reply to QFilehandle required for client-server text app. on Fri, 07 Aug 2026 06:20:24 GMT]]></title><description><![CDATA[<p dir="auto">I didn't know that only locking part of a file is a thing. Even more so, most office formats are ZIP files, so you cannot just change parts of it. Even with a text file, if you insert text in the middle everything that comes after it has to be moved. File based synchronization for collaborative editing would be really hard to implement. I expect modern software to just communicate directly with each other.</p>
]]></description><link>https://forum.qt.io/post/839570</link><guid isPermaLink="true">https://forum.qt.io/post/839570</guid><dc:creator><![CDATA[SimonSchroeder]]></dc:creator><pubDate>Fri, 07 Aug 2026 06:20:24 GMT</pubDate></item><item><title><![CDATA[Reply to QFilehandle required for client-server text app. on Fri, 07 Aug 2026 05:57:26 GMT]]></title><description><![CDATA[<p dir="auto">As I have your attention, the QIODevice class offers functionality to access a file (local or remote).<br />
I have to add the functionality to implement use by more than one user, like locking a part of the file,<br />
and notifiying the user about events like someone else started editing the file.</p>
<p dir="auto">And I need a class for users to browse the exported/shared directories.</p>
<p dir="auto">Anyway, have a good day,</p>
<p dir="auto">Stef Bon</p>
]]></description><link>https://forum.qt.io/post/839569</link><guid isPermaLink="true">https://forum.qt.io/post/839569</guid><dc:creator><![CDATA[stefbon]]></dc:creator><pubDate>Fri, 07 Aug 2026 05:57:26 GMT</pubDate></item><item><title><![CDATA[Reply to QFilehandle required for client-server text app. on Fri, 07 Aug 2026 05:44:45 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/nils-sjoberg">@<bdi>Nils-Sjoberg</bdi></a> said in <a href="/post/839552">QFilehandle required for client-server text app.</a>:</p>
<blockquote>
<p dir="auto">QFileDevice</p>
</blockquote>
<p dir="auto">Thanks a lot. This looks exactly what I'm looking for. At first I missed the offset in read and write functions, but the seek function will give the desired functionality.</p>
<p dir="auto">Thanks again,</p>
<p dir="auto">Stef Bon</p>
]]></description><link>https://forum.qt.io/post/839568</link><guid isPermaLink="true">https://forum.qt.io/post/839568</guid><dc:creator><![CDATA[stefbon]]></dc:creator><pubDate>Fri, 07 Aug 2026 05:44:45 GMT</pubDate></item><item><title><![CDATA[Reply to QFilehandle required for client-server text app. on Fri, 07 Aug 2026 06:07:03 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jonb">@<bdi>JonB</bdi></a> Well I notice some not knowing how OSNS will work.</p>
<p dir="auto">OSNS will contact the remote documents server (which is a SSH subsystem), and gets a SSH channel. This is mapped to a local fd. So the applicartion will use an fd (behind the scenes) .</p>
<p dir="auto">So:</p>
<p dir="auto">local client fd &lt;-&gt; ssh channel &lt; --- (ssh transport) ---&gt; ssh channel -&gt;ssh subsystem (OSNS documentserver) -&gt; fd to document on remote server</p>
<p dir="auto">How the remote side handles it's side it;s up to the remote server.</p>
<p dir="auto">Stef Bon<br />
the Netherlands</p>
]]></description><link>https://forum.qt.io/post/839565</link><guid isPermaLink="true">https://forum.qt.io/post/839565</guid><dc:creator><![CDATA[stefbon]]></dc:creator><pubDate>Fri, 07 Aug 2026 06:07:03 GMT</pubDate></item><item><title><![CDATA[Reply to QFilehandle required for client-server text app. on Fri, 07 Aug 2026 05:23:15 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sgaist">@<bdi>SGaist</bdi></a> As far as I can see it's not making use of KIO.</p>
<p dir="auto">But that said, I want to create a set of tools offering an unified interface to network services.<br />
At this moment there are too many different ones. I name some:</p>
<ul>
<li>KDE use KIO as you mention</li>
<li>GNOME use GFS</li>
<li>VLC uses it's own implementation</li>
<li>LibreOffice uses it's own implementation</li>
</ul>
<p dir="auto">My software OSNS is an attempt to replace them all (and offering one interface). It's very ambitious, I know.</p>
<p dir="auto">Stef Bon<br />
the Netherlands</p>
]]></description><link>https://forum.qt.io/post/839563</link><guid isPermaLink="true">https://forum.qt.io/post/839563</guid><dc:creator><![CDATA[stefbon]]></dc:creator><pubDate>Fri, 07 Aug 2026 05:23:15 GMT</pubDate></item><item><title><![CDATA[Reply to QFilehandle required for client-server text app. on Thu, 06 Aug 2026 18:54:24 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/stefbon">@<bdi>stefbon</bdi></a> Hi,</p>
<p dir="auto">Since Calligra is part of KDE, you should check whether it already makes use of <a href="https://api.kde.org/kio-index.html" target="_blank" rel="noopener noreferrer nofollow ugc">KIO</a>. If not, then you should rather go this route as it provides everything you need for what you want to achieve.</p>
]]></description><link>https://forum.qt.io/post/839558</link><guid isPermaLink="true">https://forum.qt.io/post/839558</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Thu, 06 Aug 2026 18:54:24 GMT</pubDate></item><item><title><![CDATA[Reply to QFilehandle required for client-server text app. on Thu, 06 Aug 2026 18:09:11 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/stefbon">@<bdi>stefbon</bdi></a> said in <a href="/post/839550">QFilehandle required for client-server text app.</a>:</p>
<blockquote>
<p dir="auto">which makes use of a fd to a remote document</p>
</blockquote>
<p dir="auto">If you are saying you have been given a <code>fd</code> which does whatever you want remotely, be aware that you can "connect" it to a <code>QFile</code> via <a href="https://doc.qt.io/qt-6/qfile.html#open-3" target="_blank" rel="noopener noreferrer nofollow ugc">bool QFile::open(int fd, QIODeviceBase::OpenMode mode, QFileDevice::FileHandleFlags handleFlags = DontCloseHandle)</a>.</p>
<p dir="auto">If not you have to write your own functionality like <a class="plugin-mentions-user plugin-mentions-a" href="/user/nils-sjoberg">@<bdi>Nils-Sjoberg</bdi></a> said.</p>
]]></description><link>https://forum.qt.io/post/839554</link><guid isPermaLink="true">https://forum.qt.io/post/839554</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Thu, 06 Aug 2026 18:09:11 GMT</pubDate></item><item><title><![CDATA[Reply to QFilehandle required for client-server text app. on Thu, 06 Aug 2026 17:03:51 GMT]]></title><description><![CDATA[<p dir="auto">To achieve client-server separation of document virtualization, you need to create a custom class that inherits from QIODevice (or from QFileDevice) that implements communication via the fd or SSH/SFTP, thus replacing the QFile</p>
]]></description><link>https://forum.qt.io/post/839552</link><guid isPermaLink="true">https://forum.qt.io/post/839552</guid><dc:creator><![CDATA[Nils Sjoberg]]></dc:creator><pubDate>Thu, 06 Aug 2026 17:03:51 GMT</pubDate></item></channel></rss>