summaryrefslogtreecommitdiff
authoreilers <eilers>2004-07-18 14:37:20 (UTC)
committer eilers <eilers>2004-07-18 14:37:20 (UTC)
commit30775961a5c33d4721395eb07d11c4fcc142ce96 (patch) (unidiff)
tree99858db337e64689f31b0099c48a26a41e1fc136
parentf37561246bc7d8bf4cf791ce156afdf098552dca (diff)
downloadopie-30775961a5c33d4721395eb07d11c4fcc142ce96.zip
opie-30775961a5c33d4721395eb07d11c4fcc142ce96.tar.gz
opie-30775961a5c33d4721395eb07d11c4fcc142ce96.tar.bz2
Fixed bugreport #1370 and
added check, whether source and destdatabase is the same..
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/tools/pimconverter/converter.cpp34
-rwxr-xr-xnoncore/tools/pimconverter/converter.h3
2 files changed, 36 insertions, 1 deletions
diff --git a/noncore/tools/pimconverter/converter.cpp b/noncore/tools/pimconverter/converter.cpp
index 7d34b24..ded59b6 100644
--- a/noncore/tools/pimconverter/converter.cpp
+++ b/noncore/tools/pimconverter/converter.cpp
@@ -16,2 +16,3 @@
16#include <qcheckbox.h> 16#include <qcheckbox.h>
17#include <qmessagebox.h>
17 18
@@ -24,3 +25,4 @@ Converter::Converter():
24 m_selectedSourceFormat( XML ), 25 m_selectedSourceFormat( XML ),
25 m_selectedDestFormat( SQL ) 26 m_selectedDestFormat( SQL ),
27 m_criticalState( false )
26{ 28{
@@ -53,2 +55,13 @@ void Converter::start_conversion(){
53 55
56 odebug << "SourceFormat: " << m_selectedSourceFormat << oendl;
57 odebug << "DestFormat: " << m_selectedDestFormat << oendl;
58 if ( m_selectedSourceFormat == m_selectedDestFormat ){
59
60 QMessageBox::warning( this, "PimConverter",
61 tr( "It is not a good idea to use\n" )
62 +tr( "the same source and destformat !" ),
63 tr( "Ok" ) );
64 return;
65 }
66
54 switch( m_selectedSourceFormat ){ 67 switch( m_selectedSourceFormat ){
@@ -144,2 +157,4 @@ void Converter::start_conversion(){
144 157
158 m_criticalState = true;
159
145 sourceDB -> load(); 160 sourceDB -> load();
@@ -171,2 +186,4 @@ void Converter::start_conversion(){
171 186
187 m_criticalState = false;
188
172 // Delete the frontends. Backends will be deleted automatically, too ! 189 // Delete the frontends. Backends will be deleted automatically, too !
@@ -195,2 +212,17 @@ void Converter::start_conversion(){
195 212
213void Converter::closeEvent( QCloseEvent *e )
214{
215
216 /* Due to the fact that we don't have multitasking here, this
217 * critical handling don't make sense, but the future..
218 */
219 if ( m_criticalState ){
220 e->ignore();
221 return;
222 }
223 e->accept();
224}
225
226
227
196int main( int argc, char** argv ) { 228int main( int argc, char** argv ) {
diff --git a/noncore/tools/pimconverter/converter.h b/noncore/tools/pimconverter/converter.h
index 27d7fb2..a78c6bc 100755
--- a/noncore/tools/pimconverter/converter.h
+++ b/noncore/tools/pimconverter/converter.h
@@ -16,2 +16,4 @@ public:
16 void selectedSourceFormat( int num ); 16 void selectedSourceFormat( int num );
17
18 void closeEvent( QCloseEvent *e );
17 19
@@ -35,2 +37,3 @@ private:
35 int m_selectedDestFormat; 37 int m_selectedDestFormat;
38 bool m_criticalState;
36 39