AccountConfigurationDialog const statics

6 views
Skip to first unread message

Prakash

unread,
Mar 3, 2010, 1:47:47 PM3/3/10
to Qwit
Hi,

I hit a compilation error on windows (VS2008 sdk, QtCreator) on redef
of ActionAdd & ActionEdit in the corresponding .cpp file.

Commenting these lines in .cpp file worked for me.
const int AccountConfigurationDialog::ActionAdd;
const int AccountConfigurationDialog::ActionEdit;

to me,
static const int ActionAdd = 0;
static const int ActionEdit = 1;

is a good case to be enums rather than const ints coz they are const
and int, no one can modify it, etc.

Is there a certain compiler issues for them being static const ints
rather than enum? Current code as is does not compile on Windows, but
compiled fine on mac (without ppc in pro)

-prakash

Artem Iglikov

unread,
Mar 3, 2010, 8:25:03 PM3/3/10
to qw...@googlegroups.com
As I remember, it was successfully compiled on Windows using MinGW
GCC. But, maybe, you're right and they should be enums...

> --
> You received this message because you are subscribed to the Google Groups "Qwit" group.
> To post to this group, send email to qw...@googlegroups.com.
> To unsubscribe from this group, send email to qwit+uns...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/qwit?hl=en.
>
>

--
Best regards, Artem Iglikov
http://kiwi.kz technical specialist

I do know everything, just not all at once. It's a virtual memory problem.

Prakash

unread,
Mar 3, 2010, 10:08:44 PM3/3/10
to Qwit
I can make this change to get my hand dirty a little bit. So how do I
contribute a code change and to whom?


-prakash

On Mar 3, 5:25 pm, Artem Iglikov <artem.igli...@gmail.com> wrote:
> As I remember, it was successfully compiled on Windows using MinGW
> GCC. But, maybe, you're right and they should be enums...
>
>
>
> On Thu, Mar 4, 2010 at 12:47 AM, Prakash <prakash.na...@gmail.com> wrote:
> > Hi,
>
> > I hit a compilation error on windows (VS2008 sdk, QtCreator) on redef
> > of ActionAdd & ActionEdit in the corresponding .cpp file.
>
> > Commenting these lines in .cpp file worked for me.
> > const int AccountConfigurationDialog::ActionAdd;
> > const int AccountConfigurationDialog::ActionEdit;
>
> > to me,
> >        static const int ActionAdd = 0;
> >        static const int ActionEdit = 1;
>
> > is a good case to be enums rather than const ints coz they are const
> > and int, no one can modify it, etc.
>
> > Is there a certain compiler issues for them being static const ints
> > rather than enum? Current code as is does not compile on Windows, but
> > compiled fine on mac (without ppc in pro)
>
> > -prakash
>
> > --
> > You received this message because you are subscribed to the Google Groups "Qwit" group.
> > To post to this group, send email to qw...@googlegroups.com.
> > To unsubscribe from this group, send email to qwit+uns...@googlegroups.com.

> > For more options, visit this group athttp://groups.google.com/group/qwit?hl=en.
>
> --
> Best regards, Artem Iglikovhttp://kiwi.kztechnical specialist

Artem Iglikov

unread,
Mar 3, 2010, 10:10:00 PM3/3/10
to qw...@googlegroups.com
Can you create a patch and submit it here?

> For more options, visit this group at http://groups.google.com/group/qwit?hl=en.
>
>

--
Best regards, Artem Iglikov

http://kiwi.kz technical specialist

Prakash

unread,
Mar 3, 2010, 10:32:42 PM3/3/10
to Qwit
Index: C:/qwit/qwit-read-only/src/AccountConfigurationDialog.h
===================================================================
--- C:/qwit/qwit-read-only/src/AccountConfigurationDialog.h (revision
305)
+++ C:/qwit/qwit-read-only/src/AccountConfigurationDialog.h (working
copy)
@@ -39,8 +39,10 @@
Q_OBJECT

public:
- static const int ActionAdd = 0;
- static const int ActionEdit = 1;
+ enum {
+ ActionAdd = 0,
+ ActionEdit = 1
+ };

int action;
int accountId;
Index: C:/qwit/qwit-read-only/src/AccountConfigurationDialog.cpp
===================================================================
--- C:/qwit/qwit-read-only/src/AccountConfigurationDialog.cpp
(revision 305)
+++ C:/qwit/qwit-read-only/src/AccountConfigurationDialog.cpp (working
copy)
@@ -35,9 +35,6 @@

#include "AccountConfigurationDialog.h"

-const int AccountConfigurationDialog::ActionAdd;
-const int AccountConfigurationDialog::ActionEdit;
-
AccountConfigurationDialog::AccountConfigurationDialog(QWidget
*parent): QDialog(parent) {
setupUi(this);
connect(useHttpsCheckBox, SIGNAL(stateChanged(int)), this,
SLOT(useHttpsCheckBoxChanged(int)));

Not sure if it is possible to attach a file to this forum, but here is
the text if you find it useful and pastbin link http://paste.lisp.org/display/95906

-prakash

Artem Iglikov

unread,
Mar 4, 2010, 12:00:04 AM3/4/10
to qw...@googlegroups.com
Thank you, applied in r306

> For more options, visit this group at http://groups.google.com/group/qwit?hl=en.
>
>

--
Best regards, Artem Iglikov

http://kiwi.kz technical specialist

Reply all
Reply to author
Forward
0 new messages