-
Notifications
You must be signed in to change notification settings - Fork 667
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Split sharedialog code #3773
Split sharedialog code #3773
Conversation
b5d49f2
to
4b789f9
Compare
/** | ||
* Set the password of a share | ||
* | ||
* @param password The apssword of the share, if the password is empty the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/apssword/password
Ideally, my long term goal would be that libsync would be for the sync engine. |
@ogoffart ah mm, then we could also move the jobs to the gui for now... I'll move them to the gui for now. |
Not sure I agree with @ogoffart .. sharing will be more prominent in future.. hm |
Not agreeing with @ogoffart is hardly an option. |
4b789f9
to
b94aa63
Compare
So finally my qt5 setup is running :) Please tests and review :) |
explicit OcsShareJob(AccountPtr account, QObject *parent = 0); | ||
|
||
/** | ||
* Constructors for exisiting shares of which we know the shareId |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/exisitng/existing/
b94aa63
to
adc7e9f
Compare
@phil-davis thanks. Fixed |
QList<QPair<QString, QString> > getParams; | ||
getParams.append(qMakePair(QString::fromLatin1("path"), path)); | ||
setGetParams(getParams); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think an API that provides a method addParam( QPair())
instead of the setGetParams(QList())
would be nicer because it would save to set up the List and all the pairing here. Could we also use just an addParam()
rather than addGetParam() and addPostParam()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I like that. let me take care of that.
Apart from my comment above (which is kind of minor but maybe still nice to have) I like this very much 👍 As usual my question: Do we see any chance to (unit-) test our job implementations, especially with a focus on error handling that we do? Any idea? |
@rullzer Feel free to defer my comment about splitting this into several classes and result parsing to later. I think this is already way nicer right now! :) |
There is now a generic OCSJob which must be inherited by other jobs. This is in prepartion for the other OCS job that will come (for the Sharee API endpoint for example). More logic is moved from the sharedialog to the OcsShareJob. So in the GUI code we now only say what we want (a new share, set the password etc). And the code in libsync will make that happen. Error handling is for now still done in the GUI part. For now the ocsjob and ocssharejob live in gui but probabaly we should create a libshare or libocs at some point.
* Comments * Use the path of the abstractnetworkjob
Fixes are on their way. Basically what I noticed is that yet another layer of abstraction would be nice. So that we have share objects. Then the gui interacts with a share object (sets password etc). The object in the background then makes sure that the proper jobs are fired etc. That should make the gui code even cleaner and allow us to have really proper separation between the logic and the gui. But also that is future work. |
* Pass the share_id to the functions that need it
adc7e9f
to
40ab3ee
Compare
* @ingroup gui | ||
* | ||
* Base class for jobs that talk to the OCS endpoints on the server. | ||
* All the comminication logic is handled in this class. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/comminication/communication/
I will just add low-value comments by finding the comment typos, and along the way maybe some day be able to learn how this beast all fits together and then contribute something actually useful :)
@rullzer The fixes so far look good. Unfortunately I won't have time for another full review next week. |
Thanks @ckamm @phil-davis |
CREATE = 4, | ||
DELETE = 8, | ||
SHARE = 16, | ||
ALL = 31 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not READ | UPDATE | ... ?
In preparation of the full desktop sharing (#3737) the sharedialog code had to be somewhat unentangled.
There now is more code in libsync and the gui is cleaned up a bit.
My tests show that everything still works as expected but please run your own tests to make sure I did not break anything!
CC: @dragotin @guruz @ogoffart and others that want to test!