On 08/10/2008 11:46, Jean-Marc Lasgouttes wrote:
Enrico Forestieri<[EMAIL PROTECTED]> writes:
With this patch, X_DISPLAY_MISSING is not defined in config.h and this
is used in a couple of places in the code for distinguishing between
Qt4/X11 and Qt4/Win Cygwin builds.
I took a look at these two uses of X_DISPLAY_MISSING and they look
highly suspicious:
docstring const externalLineEnding(docstring const& str)
{
#if defined(__APPLE__)
// The MAC clipboard uses \r for lineendings, and we use \n
return subst(str, '\n', '\r');
#elif defined (_WIN32) || (defined (__CYGWIN__)&& defined
(X_DISPLAY_MISSING))
// Windows clipboard uses \r\n for lineendings, and we use \n
return subst(str, from_ascii("\n"), from_ascii("\r\n"));
#else
return str;
#endif
}
This code is only useful for the Clipboard, which is in frontend anyway.
We have reliable way to check twhat we want in the frontend. For
example, the code above is wrong in the Mac/X11 case.
This code should go to frontends/qt4/qt_helpers.*
Agreed, internalLineEnding() as well.
Concerning the second one:
int parse_geometry(string const& arg1, string const&, string&)
{
geometryArg = arg1;
#if defined(_WIN32) || (defined(__CYGWIN__)&& defined(X_DISPLAY_MISSING))
// remove also the arg
return 1;
#else
// don't remove "-geometry"
return -1;
#endif
}
I am not sure what this does exactly :) I guess this is related to the
frontend handling geometry stuff natively,
Yes, this is about letting QApplication handle this on platforms that
support it (i.e. X11).
but it should go to
Application instead.
No objection but the problem is that GuiApplication (and QApplication)
takes argc and argv as arguments. We just have to verify that
QApplication won't complain on Win and Mac if we don't prune out the
'-geometry' argument.
Abdel, what is the semantics of the -geometry flag these days (on the
different platforms)?
'-geometry' is pruned out from argc on Win and Mac and passed to QApplication
on X11.
At least we could have a
bool Application::handleGeometryFlag()
method to the right thing.
No, just let GuiApplication ctor handle argc and argv directly, no need
for an additional virutal interface IMO.
Abdel.