author | mickeyl <mickeyl> | 2003-12-02 15:29:06 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2003-12-02 15:29:06 (UTC) |
commit | e215d4b2bc542b557913ba3dcd57fd20a5a2a0fe (patch) (unidiff) | |
tree | 8bb36647649cebf7c204ce58adcb820f4f0c19d6 /libopie2 | |
parent | 7a7683d435cfbb4fa2d6ed99fd4a94d388402aec (diff) | |
download | opie-e215d4b2bc542b557913ba3dcd57fd20a5a2a0fe.zip opie-e215d4b2bc542b557913ba3dcd57fd20a5a2a0fe.tar.gz opie-e215d4b2bc542b557913ba3dcd57fd20a5a2a0fe.tar.bz2 |
revert the changes approaching to compile libopie2 under X11
it broke signals and slots and has to be done like zecke did it with libqpe
-rw-r--r-- | libopie2/opiecore/oapplication.cpp | 4 | ||||
-rw-r--r-- | libopie2/opiecore/oapplication.h | 9 | ||||
-rw-r--r-- | libopie2/opieui/oresource.cpp | 2 |
3 files changed, 5 insertions, 10 deletions
diff --git a/libopie2/opiecore/oapplication.cpp b/libopie2/opiecore/oapplication.cpp index 12f33cc..c3cacce 100644 --- a/libopie2/opiecore/oapplication.cpp +++ b/libopie2/opiecore/oapplication.cpp | |||
@@ -33,49 +33,49 @@ | |||
33 | #include <opie2/odebug.h> | 33 | #include <opie2/odebug.h> |
34 | 34 | ||
35 | #include <signal.h> | 35 | #include <signal.h> |
36 | #include <stdio.h> | 36 | #include <stdio.h> |
37 | 37 | ||
38 | OApplication* OApplication::_instance = 0; | 38 | OApplication* OApplication::_instance = 0; |
39 | 39 | ||
40 | /**************************************************************************************************/ | 40 | /**************************************************************************************************/ |
41 | /* OApplicationPrivate | 41 | /* OApplicationPrivate |
42 | /**************************************************************************************************/ | 42 | /**************************************************************************************************/ |
43 | 43 | ||
44 | class OApplicationPrivate | 44 | class OApplicationPrivate |
45 | { | 45 | { |
46 | public: | 46 | public: |
47 | OApplicationPrivate() {}; | 47 | OApplicationPrivate() {}; |
48 | ~OApplicationPrivate() {}; | 48 | ~OApplicationPrivate() {}; |
49 | }; | 49 | }; |
50 | 50 | ||
51 | /**************************************************************************************************/ | 51 | /**************************************************************************************************/ |
52 | /* OApplication | 52 | /* OApplication |
53 | /**************************************************************************************************/ | 53 | /**************************************************************************************************/ |
54 | 54 | ||
55 | 55 | ||
56 | OApplication::OApplication( int& argc, char** argv, const QCString& rAppName ) | 56 | OApplication::OApplication( int& argc, char** argv, const QCString& rAppName ) |
57 | :OpieApplication( argc, argv ), | 57 | :QPEApplication( argc, argv ), |
58 | _appname( rAppName ), | 58 | _appname( rAppName ), |
59 | _config( 0 ) | 59 | _config( 0 ) |
60 | { | 60 | { |
61 | init(); | 61 | init(); |
62 | } | 62 | } |
63 | 63 | ||
64 | 64 | ||
65 | OApplication::~OApplication() | 65 | OApplication::~OApplication() |
66 | { | 66 | { |
67 | delete d; | 67 | delete d; |
68 | if ( _config ) | 68 | if ( _config ) |
69 | delete _config; | 69 | delete _config; |
70 | OApplication::_instance = 0; | 70 | OApplication::_instance = 0; |
71 | // after deconstruction of the one-and-only application object, | 71 | // after deconstruction of the one-and-only application object, |
72 | // the construction of another object is allowed | 72 | // the construction of another object is allowed |
73 | } | 73 | } |
74 | 74 | ||
75 | 75 | ||
76 | OConfig* OApplication::config() | 76 | OConfig* OApplication::config() |
77 | { | 77 | { |
78 | if ( !_config ) | 78 | if ( !_config ) |
79 | { | 79 | { |
80 | _config = new OConfig( _appname ); | 80 | _config = new OConfig( _appname ); |
81 | } | 81 | } |
@@ -87,40 +87,40 @@ void OApplication::init() | |||
87 | { | 87 | { |
88 | d = new OApplicationPrivate(); | 88 | d = new OApplicationPrivate(); |
89 | if ( !OApplication::_instance ) | 89 | if ( !OApplication::_instance ) |
90 | { | 90 | { |
91 | OApplication::_instance = this; | 91 | OApplication::_instance = this; |
92 | 92 | ||
93 | /* register SIGSEGV handler to give programs an option | 93 | /* register SIGSEGV handler to give programs an option |
94 | * to exit gracefully, e.g. save or close devices or files. | 94 | * to exit gracefully, e.g. save or close devices or files. |
95 | struct sigaction sa; | 95 | struct sigaction sa; |
96 | sa.sa_handler = ( void (*)(int) ) &segv_handler; | 96 | sa.sa_handler = ( void (*)(int) ) &segv_handler; |
97 | sa.sa_flags = SA_SIGINFO | SA_RESTART; | 97 | sa.sa_flags = SA_SIGINFO | SA_RESTART; |
98 | sigemptyset(&sa.sa_mask); | 98 | sigemptyset(&sa.sa_mask); |
99 | sigaction(SIGSEGV, &sa, NULL); | 99 | sigaction(SIGSEGV, &sa, NULL); |
100 | */ | 100 | */ |
101 | } | 101 | } |
102 | else | 102 | else |
103 | { | 103 | { |
104 | qFatal( "OApplication: Can't create more than one OApplication object. Aborting." ); | 104 | qFatal( "OApplication: Can't create more than one OApplication object. Aborting." ); |
105 | } | 105 | } |
106 | } | 106 | } |
107 | 107 | ||
108 | 108 | ||
109 | void OApplication::showMainWidget( QWidget* widget, bool nomax ) | 109 | void OApplication::showMainWidget( QWidget* widget, bool nomax ) |
110 | { | 110 | { |
111 | OpieApplication::showMainWidget( widget, nomax ); | 111 | QPEApplication::showMainWidget( widget, nomax ); |
112 | widget->setCaption( _appname ); | 112 | widget->setCaption( _appname ); |
113 | } | 113 | } |
114 | 114 | ||
115 | 115 | ||
116 | void OApplication::setTitle( const QString& title ) const | 116 | void OApplication::setTitle( const QString& title ) const |
117 | { | 117 | { |
118 | if ( mainWidget() ) | 118 | if ( mainWidget() ) |
119 | { | 119 | { |
120 | if ( !title.isNull() ) | 120 | if ( !title.isNull() ) |
121 | mainWidget()->setCaption( QString(_appname) + QString( " - " ) + title ); | 121 | mainWidget()->setCaption( QString(_appname) + QString( " - " ) + title ); |
122 | else | 122 | else |
123 | mainWidget()->setCaption( _appname ); | 123 | mainWidget()->setCaption( _appname ); |
124 | } | 124 | } |
125 | } | 125 | } |
126 | 126 | ||
diff --git a/libopie2/opiecore/oapplication.h b/libopie2/opiecore/oapplication.h index a3f2201..72a659e 100644 --- a/libopie2/opiecore/oapplication.h +++ b/libopie2/opiecore/oapplication.h | |||
@@ -13,56 +13,56 @@ | |||
13 | ._= =} : or (at your option) any later version. | 13 | ._= =} : or (at your option) any later version. |
14 | .%`+i> _;_. | 14 | .%`+i> _;_. |
15 | .i_,=:_. -<s. This program is distributed in the hope that | 15 | .i_,=:_. -<s. This program is distributed in the hope that |
16 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 16 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
17 | : .. .:, . . . without even the implied warranty of | 17 | : .. .:, . . . without even the implied warranty of |
18 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 18 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
19 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 19 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
20 | ..}^=.= = ; Library General Public License for more | 20 | ..}^=.= = ; Library General Public License for more |
21 | ++= -. .` .: details. | 21 | ++= -. .` .: details. |
22 | : = ...= . :.=- | 22 | : = ...= . :.=- |
23 | -. .:....=;==+<; You should have received a copy of the GNU | 23 | -. .:....=;==+<; You should have received a copy of the GNU |
24 | -_. . . )=. = Library General Public License along with | 24 | -_. . . )=. = Library General Public License along with |
25 | -- :-=` this library; see the file COPYING.LIB. | 25 | -- :-=` this library; see the file COPYING.LIB. |
26 | If not, write to the Free Software Foundation, | 26 | If not, write to the Free Software Foundation, |
27 | Inc., 59 Temple Place - Suite 330, | 27 | Inc., 59 Temple Place - Suite 330, |
28 | Boston, MA 02111-1307, USA. | 28 | Boston, MA 02111-1307, USA. |
29 | */ | 29 | */ |
30 | 30 | ||
31 | #ifndef OAPPLICATION_H | 31 | #ifndef OAPPLICATION_H |
32 | #define OAPPLICATION_H | 32 | #define OAPPLICATION_H |
33 | 33 | ||
34 | #define oApp OApplication::oApplication() | 34 | #define oApp OApplication::oApplication() |
35 | 35 | ||
36 | 36 | ||
37 | #include "opieapplication.h" | 37 | #include <qpe/qpeapplication.h> |
38 | 38 | ||
39 | 39 | ||
40 | class OApplicationPrivate; | 40 | class OApplicationPrivate; |
41 | class OConfig; | 41 | class OConfig; |
42 | 42 | ||
43 | 43 | ||
44 | class OApplication : public OpieApplication | 44 | class OApplication : public QPEApplication |
45 | { | 45 | { |
46 | Q_OBJECT | 46 | Q_OBJECT |
47 | 47 | ||
48 | public: | 48 | public: |
49 | /** | 49 | /** |
50 | * Constructor. Parses command-line arguments and sets the window caption. | 50 | * Constructor. Parses command-line arguments and sets the window caption. |
51 | * | 51 | * |
52 | * @param rAppName application name. Will be used for finding the | 52 | * @param rAppName application name. Will be used for finding the |
53 | * associated message, icon and configuration files | 53 | * associated message, icon and configuration files |
54 | * | 54 | * |
55 | */ | 55 | */ |
56 | OApplication( int& argc, char** argv, const QCString& rAppName ); | 56 | OApplication( int& argc, char** argv, const QCString& rAppName ); |
57 | /** | 57 | /** |
58 | * Destructor. Destroys the application object and its children. | 58 | * Destructor. Destroys the application object and its children. |
59 | */ | 59 | */ |
60 | virtual ~OApplication(); | 60 | virtual ~OApplication(); |
61 | /** | 61 | /** |
62 | * @returns the process-wide application object | 62 | * @returns the process-wide application object |
63 | * | 63 | * |
64 | * This is similar to the global @ref QApplication pointer qApp. It | 64 | * This is similar to the global @ref QApplication pointer qApp. It |
65 | * allows access to the single global OApplication object, since | 65 | * allows access to the single global OApplication object, since |
66 | * more than one cannot be created in the same application. It | 66 | * more than one cannot be created in the same application. It |
67 | * saves you the trouble of having to pass the pointer explicitly | 67 | * saves you the trouble of having to pass the pointer explicitly |
68 | * to every function that may require it. | 68 | * to every function that may require it. |
@@ -71,40 +71,35 @@ class OApplication : public OpieApplication | |||
71 | /** | 71 | /** |
72 | * Returns the application name as given during creation. | 72 | * Returns the application name as given during creation. |
73 | * | 73 | * |
74 | * @returns a reference to the application name | 74 | * @returns a reference to the application name |
75 | */ | 75 | */ |
76 | const QCString& appName() const { return _appname; }; | 76 | const QCString& appName() const { return _appname; }; |
77 | /** | 77 | /** |
78 | * @returns the application session config object. | 78 | * @returns the application session config object. |
79 | * | 79 | * |
80 | * @see OConfig | 80 | * @see OConfig |
81 | */ | 81 | */ |
82 | OConfig* config(); | 82 | OConfig* config(); |
83 | /** | 83 | /** |
84 | * Shows the main @a widget and sets the name of the application as window caption. | 84 | * Shows the main @a widget and sets the name of the application as window caption. |
85 | */ | 85 | */ |
86 | virtual void showMainWidget( QWidget* widget, bool nomax = false ); | 86 | virtual void showMainWidget( QWidget* widget, bool nomax = false ); |
87 | /** | 87 | /** |
88 | * Set the application title. The application title will be concatenated | 88 | * Set the application title. The application title will be concatenated |
89 | * to the application name given in the constructor. | 89 | * to the application name given in the constructor. |
90 | * | 90 | * |
91 | * @param title the title. If not given, resets caption to appname | 91 | * @param title the title. If not given, resets caption to appname |
92 | */ | 92 | */ |
93 | virtual void setTitle( const QString& title = QString::null ) const; | 93 | virtual void setTitle( const QString& title = QString::null ) const; |
94 | 94 | ||
95 | /** | ||
96 | * see qpeDir() | ||
97 | */ | ||
98 | static QString opieDir() {return qpeDir();}; | ||
99 | |||
100 | protected: | 95 | protected: |
101 | void init(); | 96 | void init(); |
102 | 97 | ||
103 | private: | 98 | private: |
104 | const QCString _appname; | 99 | const QCString _appname; |
105 | static OApplication* _instance; | 100 | static OApplication* _instance; |
106 | OConfig* _config; | 101 | OConfig* _config; |
107 | OApplicationPrivate* d; | 102 | OApplicationPrivate* d; |
108 | }; | 103 | }; |
109 | 104 | ||
110 | #endif // OAPPLICATION_H | 105 | #endif // OAPPLICATION_H |
diff --git a/libopie2/opieui/oresource.cpp b/libopie2/opieui/oresource.cpp index d97307f..03b9d51 100644 --- a/libopie2/opieui/oresource.cpp +++ b/libopie2/opieui/oresource.cpp | |||
@@ -20,39 +20,39 @@ | |||
20 | ..}^=.= = ; Library General Public License for more | 20 | ..}^=.= = ; Library General Public License for more |
21 | ++= -. .` .: details. | 21 | ++= -. .` .: details. |
22 | : = ...= . :.=- | 22 | : = ...= . :.=- |
23 | -. .:....=;==+<; You should have received a copy of the GNU | 23 | -. .:....=;==+<; You should have received a copy of the GNU |
24 | -_. . . )=. = Library General Public License along with | 24 | -_. . . )=. = Library General Public License along with |
25 | -- :-=` this library; see the file COPYING.LIB. | 25 | -- :-=` this library; see the file COPYING.LIB. |
26 | If not, write to the Free Software Foundation, | 26 | If not, write to the Free Software Foundation, |
27 | Inc., 59 Temple Place - Suite 330, | 27 | Inc., 59 Temple Place - Suite 330, |
28 | Boston, MA 02111-1307, USA. | 28 | Boston, MA 02111-1307, USA. |
29 | */ | 29 | */ |
30 | 30 | ||
31 | #include <opie2/oapplication.h> | 31 | #include <opie2/oapplication.h> |
32 | #include <opie2/odebug.h> | 32 | #include <opie2/odebug.h> |
33 | 33 | ||
34 | #include "oresource.h" | 34 | #include "oresource.h" |
35 | 35 | ||
36 | 36 | ||
37 | #ifdef QWS | 37 | #ifdef QWS |
38 | namespace Resource | 38 | namespace Resource |
39 | { | 39 | { |
40 | 40 | ||
41 | QPixmap loadPixmap( const QString& pix ) | 41 | QPixmap loadPixmap( const QString& pix ) |
42 | { | 42 | { |
43 | QString filename; | 43 | QString filename; |
44 | filename.sprintf( "%s/%s.png", (const char*) oApp->opieDir(), (const char*) pix ); | 44 | filename.sprintf( "%s/%s.png", (const char*) oApp->qpeDir(), (const char*) pix ); |
45 | QPixmap pixmap( filename ); | 45 | QPixmap pixmap( filename ); |
46 | if ( pixmap.isNull() ) | 46 | if ( pixmap.isNull() ) |
47 | { | 47 | { |
48 | odebug << "libopie2 resource: can't find pixmap " << filename << oendl;; | 48 | odebug << "libopie2 resource: can't find pixmap " << filename << oendl;; |
49 | } | 49 | } |
50 | return pixmap; | 50 | return pixmap; |
51 | }; | 51 | }; |
52 | 52 | ||
53 | }; | 53 | }; |
54 | 54 | ||
55 | #endif | 55 | #endif |
56 | 56 | ||
57 | 57 | ||
58 | 58 | ||