Discussion:
QT_NO_SESSION_MANAGER defined ?
(too old to reply)
Vincent van Ravesteijn
2010-11-12 16:57:14 UTC
Permalink
Hi,

I got hit by bug http://bugs.gentoo.org/show_bug.cgi?id=212086. It
needed some time of googling to find out what the problem was, as the
error message is not very informative:

error: invalid use of undefined type 'struct QSessionManager'
/usr/include/qt4/QtGui/qapplication.h:63: error: forward declaration of 'struct
QSessionManager'


Anyone against adding this error message ?

Index: src/frontends/qt4/GuiApplication.cpp
===================================================================
--- src/frontends/qt4/GuiApplication.cpp (revision 36264)
+++ src/frontends/qt4/GuiApplication.cpp (working copy)
@@ -2268,8 +2268,14 @@
/// interaction.
/// We are changing that to close all wiew one by one.
/// FIXME: verify if the default implementation is enough now.
- if (sm.allowsInteraction() && !closeAllViews())
- sm.cancel();
+
+ #ifdef QT_NO_SESSIONMANAGER
+ #error Qt is compiled without session manager, please
recompile Qt
+ (void) sm;
+ #else
+ if (sm.allowsInteraction() && !closeAllViews())
+ sm.cancel();
+ #endif
}

Vincent
Pavel Sanda
2010-11-12 18:20:29 UTC
Permalink
Post by Vincent van Ravesteijn
Anyone against adding this error message ?
ok with me.
Post by Vincent van Ravesteijn
- if (sm.allowsInteraction() && !closeAllViews())
- sm.cancel();
+
+ #ifdef QT_NO_SESSIONMANAGER
+ #error Qt is compiled without session manager, please
recompile Qt
this is the second time you use "(void)". why?

pavel
Pavel Sanda
2010-11-12 18:43:38 UTC
Permalink
Post by Pavel Sanda
this is the second time you use "(void)". why?
pavel
To avoid a warning.
i see.
When was the first time then ?
few weeks ago i saw it, and it might be not yours commit, can't find it now :)

pavel
Vincent van Ravesteijn
2010-11-12 18:48:50 UTC
Permalink
Post by Pavel Sanda
Post by Pavel Sanda
this is the second time you use "(void)". why?
pavel
To avoid a warning.
i see.
When was the first time then ?
few weeks ago i saw it, and it might be not yours commit, can't find it now :)
pavel
I can tell you.

It was Richard who committed it. And it was in
GuiApplication::dispatch in the case LFUN_HELP_OPEN.

I was just wondering why you though it was me :p, because I forgot that.

Vincent
Pavel Sanda
2010-11-12 19:22:37 UTC
Permalink
Post by Vincent van Ravesteijn
I can tell you.
It was Richard who committed it. And it was in
GuiApplication::dispatch in the case LFUN_HELP_OPEN.
I was just wondering why you though it was me :p, because I forgot that.
ha! now i know why i thought it was you - remembered the question mark on some
strange fix which got wrongly associtaed with this, poor memory :)

so when are at it - r35919, what was the compil error?
or just warn of unused var?

pavel
Vincent van Ravesteijn
2010-11-12 19:59:14 UTC
Permalink
Post by Pavel Sanda
so when are at it - r35919, what was the compil error?
or just warn of unused var?
Yes, unused var, but apparently one of my compilers treated that
warning as an error.

Then, there was a warning about the statement "buf;" which has no effect.

Vincent

Vincent van Ravesteijn
2010-11-12 18:25:44 UTC
Permalink
Post by Pavel Sanda
Post by Vincent van Ravesteijn
Anyone against adding this error message ?
ok with me.
Post by Vincent van Ravesteijn
-       if (sm.allowsInteraction() && !closeAllViews())
-               sm.cancel();
+
+       #ifdef QT_NO_SESSIONMANAGER
+               #error Qt is compiled without session manager, please
recompile Qt
this is the second time you use "(void)". why?
pavel
To avoid a warning.

When was the first time then ?

Vincent
Loading...