[Kde-games-devel] KMahjongg frameworks branch

Ian Wadham iandw.au at gmail.com
Thu Dec 10 23:37:20 UTC 2015


Hi Frederik,

On 10/12/2015, at 8:15 PM, Frederik Schwarzer wrote:
> with respect to kdelibs4support, I read in a thread on this list, 
> where you discussed the use of KIO with Jeremy.
> https://mail.kde.org/pipermail/kde-games-devel/2015-January/011546.html
> 
> If I got the correctly, you kind of voted for not keeping the network 
> saving ability in KMahjongg.

I thought I was strongly in favour of using local files only in KMahjongg,
but with British understatement… :-)  The game effectively forces using
local files for saves, so why not use the file-dialog method that does that?
Not "Url" methods.

> From the code (although I am not familiar with saving/loading) it 
> seems that KMahjongg is currently able to load a file from a network 
> location but not to save one to a network location.
> 
> One of the rare things I could find regarding porting away from 
> NetAccess::download, is the Umbrello code, where this one line was 
> replaced by ~15 lines of checking this and checking that.
> 
> Of course we could do the same as Umbrello but since KMahjongg can 
> only read from the network, and that network locations for games might 
> be a very rare case, I think it is reasonable to remove network 
> loading/saving abilities.
> 
> Or does QFileDialog already deliver that? Here it does not show 
> network folders.

Whether QFileDialog supports network saving/loading is platform-dependent.
See the doco for getSaveFileUrl() and getOpenFileUrl() at
http://doc.qt.io/qt-5/qfiledialog.html#getOpenFileUrl

I think QFileDialog may be purely local on Apple OS X, but the bonus is that it
gives you a native file dialog (i.e. like file dialogs in non-KDE apps) --- much
less confusing for the end-user… :-)

> Opinions?

If you really want to save a KMahjongg game on the network, you can first
save it locally, then propagate it to whatever location you want by whatever
user techniques you want (e.g. email, bugzilla attachment, Facebook, Dropbox,
etc.).  Then it is clear to both sender and receiver where it has gone and how.
So I favour using local-file methods only in KMahjongg.

I would say the same for other games that are not actually network-oriented,
such as Palapeli and KSudoku, but which contain code for network I/O.

Cheers, Ian W.



More information about the kde-games-devel mailing list