D10249: Option to exit after printing

2018-03-03 Thread Albert Astals Cid
This revision was automatically updated to reflect the committed changes. Closed by commit R223:09b7b079ac92: Option to exit after printing (authored by dileepsankhla, committed by aacid). CHANGED PRIOR TO COMMIT https://phabricator.kde.org/D10249?vs=28360=28500#toc REPOSITORY R223 Okular

D10249: Option to exit after printing

2018-03-03 Thread Albert Astals Cid
aacid accepted this revision. aacid added a comment. This revision is now accepted and ready to land. Looks good now :) REPOSITORY R223 Okular BRANCH fixing REVISION DETAIL https://phabricator.kde.org/D10249 To: dileepsankhla, aacid, #okular, ngraham Cc: ltoscano, ngraham, aacid,

D10249: Option to exit after printing

2018-03-01 Thread Dileep Sankhla
dileepsankhla updated this revision to Diff 28360. dileepsankhla added a comment. Updating D10249 <https://phabricator.kde.org/D10249>: Option to exit after printing Removed the autotest and just updated the `serializedOptions` parameters. REPOSITORY R223 Okular CHANGES SINC

D10249: Option to exit after printing

2018-03-01 Thread Dileep Sankhla
dileepsankhla added a comment. Oops! As I was getting errors in the autotests/mainshelltest.cpp file while `make` okular, I assumed the autotest didn't compile and build successfully. I also assumed the `make` command runs the tests too. Now running with ./autotests/mainshelltest, I got

D10249: Option to exit after printing

2018-02-22 Thread Albert Astals Cid
aacid added a comment. You mean you don't get this? ./autotests/mainshelltest - Start testing of MainShellTest * Config: Using QtTest library 5.10.1, Qt 5.10.1 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 7.3.0) PASS :

D10249: Option to exit after printing

2018-02-21 Thread Dileep Sankhla
dileepsankhla added a comment. No I ran the tests too and it was a success. REPOSITORY R223 Okular REVISION DETAIL https://phabricator.kde.org/D10249 To: dileepsankhla, aacid, #okular, ngraham Cc: ltoscano, ngraham, aacid, #okular, michaelweghorn

D10249: Option to exit after printing

2018-02-21 Thread Albert Astals Cid
aacid requested changes to this revision. This revision now requires changes to proceed. REPOSITORY R223 Okular REVISION DETAIL https://phabricator.kde.org/D10249 To: dileepsankhla, aacid, #okular, ngraham Cc: ltoscano, ngraham, aacid, #okular, michaelweghorn

D10249: Option to exit after printing

2018-02-21 Thread Albert Astals Cid
aacid added a comment. Have you tried running the test or did you add stuff just blindly in? REPOSITORY R223 Okular REVISION DETAIL https://phabricator.kde.org/D10249 To: dileepsankhla, aacid, #okular, ngraham Cc: ltoscano, ngraham, aacid, #okular, michaelweghorn

D10249: Option to exit after printing

2018-02-13 Thread Dileep Sankhla
dileepsankhla updated this revision to Diff 27086. dileepsankhla added a comment. Updating D10249 <https://phabricator.kde.org/D10249>: Option to exit after printing Tried my best to edit the data driven tests by adding appropriate data to the table using QTest::newRow fu

D10249: Option to exit after printing

2018-02-11 Thread Albert Astals Cid
aacid added inline comments. INLINE COMMENTS > mainshelltest.cpp:215 > +QTest::newRow("print attach unique tabs") << file1 << optionsUnique << > true << contentsEpub[0] << 0u << false << false << false << true << 2u << > false << true; > +QTest::newRow("print attach unique tabs and

D10249: Option to exit after printing

2018-02-10 Thread Dileep Sankhla
dileepsankhla marked an inline comment as done. dileepsankhla added a comment. @aacid I have talked about using std::exit instead of QCoreApplication::exit here : https://phabricator.kde.org/D10249#200260 With that, I want to add QCoreApplication::exit does nothing if the event loop is

D10249: Option to exit after printing

2018-02-10 Thread Albert Astals Cid
aacid added inline comments. INLINE COMMENTS > part.cpp:3217 > +if ( success && m_cliPrintAndExit ) > +exit ( EXIT_SUCCESS ); > +else if ( m_cliPrintAndExit ) We discussed a bit on IRC but i don't remeber which your reason for not using QCoreApplication::exit were,

D10249: Option to exit after printing

2018-02-08 Thread Dileep Sankhla
dileepsankhla updated this revision to Diff 26778. dileepsankhla added a comment. Updating https://phabricator.kde.org/D10249: Option to exit after printing renamed isError variable to success and changed the option with -print-and-exit. REPOSITORY R223 Okular CHANGES SINCE LAST UPDATE

D10249: Option to exit after printing

2018-02-07 Thread Luigi Toscano
ltoscano added inline comments. INLINE COMMENTS > mainshelltest.cpp:320 > + if (externalProcessExpectPrintDialogAndExit) > +args << QStringLiteral("-print_and_exit"); > p.start(QStringLiteral(OKULAR_BINARY), args); Regarding this option: shouldn't it be -print-and-exit

D10249: Option to exit after printing

2018-02-07 Thread Albert Astals Cid
aacid added inline comments. INLINE COMMENTS > part.cpp:3240 > > -void Part::doPrint(QPrinter ) > +bool Part::doPrint(QPrinter ) > { Can you please make doPrint return true on success and not on error? It's a much saner API. REPOSITORY R223 Okular REVISION DETAIL

D10249: Option to exit after printing

2018-02-05 Thread Dileep Sankhla
dileepsankhla updated this revision to Diff 26608. dileepsankhla marked an inline comment as done. dileepsankhla added a comment. Updating https://phabricator.kde.org/D10249: Option to exit after printing Initialized "isError" with false at the time of declaration. REPOSITORY R

D10249: Option to exit after printing

2018-02-05 Thread Albert Astals Cid
aacid added inline comments. INLINE COMMENTS > part.cpp:3212 > > +bool isError; > if ( printDialog->exec() ) What is the value of isError when if ( printDialog->exec() ) returns false? REPOSITORY R223 Okular REVISION DETAIL https://phabricator.kde.org/D10249 To:

D10249: Option to exit after printing

2018-02-04 Thread Dileep Sankhla
dileepsankhla updated this revision to Diff 26550. dileepsankhla added a comment. Updating https://phabricator.kde.org/D10249: Option to exit after printing local variable to slotPrint function REPOSITORY R223 Okular CHANGES SINCE LAST UPDATE https://phabricator.kde.org/D10249?vs

D10249: Option to exit after printing

2018-02-04 Thread Albert Astals Cid
aacid added a comment. That's even worse. I'll give you the answer myself. Why do you need to have that variable be global at all? It is used *exactly* in one function. REPOSITORY R223 Okular REVISION DETAIL https://phabricator.kde.org/D10249 To: dileepsankhla, aacid,

D10249: Option to exit after printing

2018-02-04 Thread Dileep Sankhla
dileepsankhla updated this revision to Diff 26547. dileepsankhla added a comment. Updating https://phabricator.kde.org/D10249: Option to exit after printing I was trying to get rid of extern keyword while declaring "isError" inside the namespace of the header file. Hence

D10249: Option to exit after printing

2018-02-04 Thread Albert Astals Cid
aacid added a comment. Why is "isError" a class member variable? REPOSITORY R223 Okular REVISION DETAIL https://phabricator.kde.org/D10249 To: dileepsankhla, aacid, #okular, ngraham Cc: ngraham, aacid, #okular, michaelweghorn

D10249: Option to exit after printing

2018-02-03 Thread Dileep Sankhla
dileepsankhla added a comment. @ngraham Can you please review my patch? REPOSITORY R223 Okular REVISION DETAIL https://phabricator.kde.org/D10249 To: dileepsankhla, aacid, #okular, ngraham Cc: ngraham, aacid, #okular, michaelweghorn

D10249: Option to exit after printing

2018-02-03 Thread Dileep Sankhla
dileepsankhla updated this revision to Diff 26453. dileepsankhla added a comment. - # Enter a commit message. 1. Updating https://phabricator.kde.org/D10249: Option to exit after printing # 2. Enter a brief description of the changes included in this update. 3. The first line is used

D10249: Option to exit after printing

2018-02-02 Thread Dileep Sankhla
dileepsankhla added a comment. @aacid Agree that only one exit call is required but what about the exit status - EXIT_SUCCESS or EXIT_FAILURE? The issue description talked about the command line batch processing. For that purpose, should I set a bool "isError" when failing condition is

D10249: Option to exit after printing

2018-02-02 Thread Albert Astals Cid
aacid added inline comments. INLINE COMMENTS > part.cpp:3219 > + delete printDialog; > + exit ( EXIT_SUCCESS ); > + } You have far too many exit calls, i'm 99% sure you could have just one. REPOSITORY R223 Okular REVISION DETAIL

D10249: Option to exit after printing

2018-02-02 Thread Dileep Sankhla
dileepsankhla added a reviewer: ngraham. REPOSITORY R223 Okular REVISION DETAIL https://phabricator.kde.org/D10249 To: dileepsankhla, aacid, #okular, ngraham Cc: ngraham, aacid, #okular, michaelweghorn

D10249: Option to exit after printing

2018-02-02 Thread Nathaniel Graham
ngraham edited the summary of this revision. REPOSITORY R223 Okular REVISION DETAIL https://phabricator.kde.org/D10249 To: dileepsankhla, aacid, #okular Cc: ngraham, aacid, #okular, michaelweghorn

D10249: Option to exit after printing

2018-02-02 Thread Dileep Sankhla
dileepsankhla edited the summary of this revision. REPOSITORY R223 Okular REVISION DETAIL https://phabricator.kde.org/D10249 To: dileepsankhla, aacid, #okular Cc: ngraham, aacid, #okular, michaelweghorn

D10249: Option to exit after printing

2018-02-02 Thread Dileep Sankhla
dileepsankhla added a reviewer: Okular. REPOSITORY R223 Okular REVISION DETAIL https://phabricator.kde.org/D10249 To: dileepsankhla, aacid, #okular Cc: ngraham, aacid, #okular, michaelweghorn

D10249: Option to exit after printing

2018-02-02 Thread Dileep Sankhla
dileepsankhla created this revision. dileepsankhla added a reviewer: aacid. Restricted Application added a subscriber: Okular. Restricted Application added a project: Okular. dileepsankhla requested review of this revision. REVISION SUMMARY When running okular with the parameter --print to