Skip to content

Commit 993c38c

Browse files
author
Koen Deforche
committed
Several fixes and improvements:
Wt::Render: fixed matching of Selector containing 3 or more identical simple selectors Fix #2029: responsive navigation bar without animations, also provide a good solution for animations+layouts interference Fix #2084: missing dllimport/export for WAbstractProxyModel::BaseItem Build: Blacklist boost 1.54 on Windows (httpd data corruption), added C++11 build option Signals: Support signals2 as signals is being dropped in newer boost versions Wt::Dbo: add updateAuthToken() to update an existing auth token (keeping its expiration time) Implement #1914: Wt::Json::serialize() functions Wt::Render: account for margin, padding, borders for minimum width calculations Fix #2071: WStringStream: make compiler bwarf on unsupported types Fix #2078, #2079 internal path redirect in progressive bootstrap application Fix #1952: WCompositeWidget::setObjectName() Fix #1948 (patch from Pierluigi Vicinanza) Wt::Render: improve table rendering: support border-collapse collapse and honor set widths Fix #2002: WTabWidget::setTabEnabled() partially working Fix #2080: Timing issue with document.body being available in progressive bootstrap WString: resolve using WServer::localizedStrings if no WApplication context is available Implemented #1602: Wt::Mail::Message::setDate() Implemented #1390: Adding support for local date/time (WLocalDateTime) implemented #1179: interpret ItemIsSelectable for enabling/disabling options in combo-box/selection box Fix #2074: inOneSecond issue (Bruce Toll) Layouts: fix problem requiring to reapply whenever a parent widget changes size Fix #2039: segfault (vector subscript out of range) in WSortFilterProxyModel Fix #2018: Wt::Http::Client actually does not append port numbers to the "Host" header Fix #2016: Wt::Http::Client::parseUrl cannot parse URLs containing username and password Fix #2067 WDateEdit: on click event not received when setEmptyText is used Config: remove the xhtml mime-type option, viva HTML5
1 parent 2d4882f commit 993c38c

File tree

119 files changed

+3172
-1194
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

119 files changed

+3172
-1194
lines changed

CMakeLists.txt

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,33 @@ OPTION(ENABLE_QT4 "Build Qt4 interworking library (libwtwithqt" ON)
103103
OPTION(WT_NO_STD_LOCALE "Build Wt to run on a system without std::locale support" OFF)
104104
OPTION(WT_NO_STD_WSTRING "Build Wt to run on a system without std::wstring support" OFF)
105105

106+
# C++11 vs C++98
107+
# Binary compatibility is not guaranteed. We give our users the choice on
108+
# how to compile Wt
109+
# We're not sure yet if you can safely link Wt compiled in 03 mode against
110+
# an application compiled in 11 mode. Boost probably causes problems here
111+
# (specially boost.signals2)
112+
IF(NOT MSVC)
113+
# For now, don't auto-detect
114+
#IF(CMAKE_COMPILER_IS_GNUCXX)
115+
# execute_process(COMMAND ${CMAKE_C_COMPILER} "-dumpversion"
116+
# OUTPUT_VARIABLE GCC_VERSION)
117+
# IF(${GCC_VERSION} VERSION_GREATER "4.5.99")
118+
# SET(HAS_CXX11 ON)
119+
# ENDIF(${GCC_VERSION} VERSION_GREATER "4.5.99")
120+
#ENDIF(CMAKE_COMPILER_IS_GNUCXX)
121+
SET(WT_CPP_11_MODE "" CACHE STRING "C++ mode to compile Wt in (leave empty for your compiler's default, or set to -std=c++11, -std=c++0x, ...)")
122+
IF(WT_CPP_11_MODE)
123+
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WT_CPP_11_MODE}")
124+
SET(HAS_CXX11 ON)
125+
ENDIF(WT_CPP_11_MODE)
126+
ELSE(NOT MSVC)
127+
# For once, msvs is easier than gcc/llvm
128+
IF(MSVC_VERSION GREATER 1600)
129+
SET(HAS_CXX11 ON)
130+
ENDIF(MSVC_VERSION GREATER 1600)
131+
ENDIF(NOT MSVC)
132+
106133
IF(APPLE)
107134
OPTION(USE_BOOST_FRAMEWORK "Uses a Boost framework" OFF)
108135
ENDIF(APPLE)
@@ -351,6 +378,27 @@ ELSE(BOOST_WT_MT_FOUND)
351378
ADD_DEFINITIONS(-DBOOST_DISABLE_THREADS -DSQLITE_THREADSAFE=0)
352379
ENDIF(BOOST_WT_MT_FOUND)
353380

381+
# decide on signals vs signals2
382+
# boost 1.54 deprecated boost signals -> use signals2
383+
IF (Boost_VERSION GREATER 105300)
384+
MESSAGE(STATUS "Boost ${Boost_VERSION} > 1.53, WT_SIGNALS_IMPLEMENTATION = boost.signals2 recommended")
385+
SET(DEFAULT_WT_SIGNALS_IMPLEMENTATION "boost.signals2")
386+
ELSE (Boost_VERSION GREATER 105300)
387+
SET(DEFAULT_WT_SIGNALS_IMPLEMENTATION "boost.signals")
388+
MESSAGE(STATUS "Boost ${Boost_VERSION} < 1.54, WT_SIGNALS_IMPLEMENTATION = boost.signals recommended")
389+
ENDIF (Boost_VERSION GREATER 105300)
390+
SET(WT_SIGNALS_IMPLEMENTATION ${DEFAULT_WT_SIGNALS_IMPLEMENTATION} CACHE STRING "Select what implementation should be used for Wt signals")
391+
SET_PROPERTY(CACHE WT_SIGNALS_IMPLEMENTATION PROPERTY STRINGS boost.signals boost.signals2)
392+
393+
IF ("${WT_SIGNALS_IMPLEMENTATION}" STREQUAL "boost.signals")
394+
MESSAGE(STATUS "Selecting boost.signals")
395+
SET(WT_USE_BOOST_SIGNALS ON)
396+
SET(WT_USE_BOOST_SIGNALS2 OFF)
397+
ELSEIF ("${WT_SIGNALS_IMPLEMENTATION}" STREQUAL "boost.signals2")
398+
MESSAGE(STATUS "Selecting boost.signals2")
399+
SET(WT_USE_BOOST_SIGNALS OFF)
400+
SET(WT_USE_BOOST_SIGNALS2 ON)
401+
ENDIF ("${WT_SIGNALS_IMPLEMENTATION}" STREQUAL "boost.signals")
354402

355403

356404
FIND_PACKAGE(Doxygen)

WConfig.h.in

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,8 @@
3939
#cmakedefine WT_NO_STD_WSTRING
4040
#cmakedefine WT_DEBUG_ENABLED
4141

42-
// Only one of the two below should be selected
4342
#cmakedefine WT_USE_BOOST_SIGNALS
4443
#cmakedefine WT_USE_BOOST_SIGNALS2
45-
#define WT_USE_BOOST_SIGNALS
4644

4745
#endif
4846

cmake/WtFindFcgi.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,14 @@ FIND_PATH(FCGI_INCLUDE_DIR
1717
FIND_LIBRARY(FCGI_LIB fcgi
1818
${FCGI_PREFIX}/lib
1919
/usr/lib
20+
/usr/lib64
2021
/usr/local/lib
2122
)
2223

2324
FIND_LIBRARY(FCGIPP_LIB fcgi++
2425
${FCGI_PREFIX}/lib
2526
/usr/lib
27+
/usr/lib64
2628
/usr/local/lib
2729
)
2830

examples/CMakeLists.txt

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -174,23 +174,10 @@ SUBDIRS(
174174
wtwithqt
175175
)
176176

177-
IF(MSVC_VERSION)
178-
IF(MSVC_VERSION GREATER 1600)
179-
SET(HAS_CXX11 ON)
180-
ENDIF(MSVC_VERSION GREATER 1600)
181-
ENDIF(MSVC_VERSION)
182-
IF(CMAKE_COMPILER_IS_GNUCXX)
183-
execute_process(COMMAND ${CMAKE_C_COMPILER} "-dumpversion"
184-
OUTPUT_VARIABLE GCC_VERSION)
185-
IF(${GCC_VERSION} VERSION_GREATER "4.5.99")
186-
SET(HAS_CXX11 ON)
187-
ENDIF(${GCC_VERSION} VERSION_GREATER "4.5.99")
188-
ENDIF(CMAKE_COMPILER_IS_GNUCXX)
189-
190177
IF(HAS_CXX11)
191178
SUBDIRS(
192179
widgetgallery
193180
)
194181
ELSE(HAS_CXX11)
195-
MESSAGE("Not building widget gallery; a C++11 compiler is required (gcc > 4.6 or MSVS 2012)")
182+
MESSAGE("*** Not building widget gallery; C++11 required (gcc > 4.6 + set WT_CPP_11_MODE=-std=c++0x or MSVS >= 2012)")
196183
ENDIF(HAS_CXX11)

examples/blog/model/BlogUserDatabase.C

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,24 @@ void BlogUserDatabase::addAuthToken(const Auth::User& user,
195195
(dbo::ptr<Token>(new Token(token.hash(), token.expirationTime())));
196196
}
197197

198+
int BlogUserDatabase::updateAuthToken(const Auth::User& user,
199+
const std::string& hash,
200+
const std::string& newHash)
201+
{
202+
WithUser find(*this, user);
203+
204+
for (Tokens::const_iterator i = user_->authTokens.begin();
205+
i != user_->authTokens.end(); ++i) {
206+
if ((*i)->value == hash) {
207+
dbo::ptr<Token> p = *i;
208+
p.modify()->value = newHash;
209+
return std::max(Wt::WDateTime::currentDateTime().secsTo(p->expires), 0);
210+
}
211+
}
212+
213+
return 0;
214+
}
215+
198216
void BlogUserDatabase::removeAuthToken(const Auth::User& user,
199217
const std::string& hash)
200218
{

examples/blog/model/BlogUserDatabase.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ class BlogUserDatabase : public Wt::Auth::AbstractUserDatabase
5151

5252
virtual void addAuthToken(const Wt::Auth::User& user,
5353
const Wt::Auth::Token& token);
54+
virtual int updateAuthToken(const Wt::Auth::User& user,
55+
const std::string& hash,
56+
const std::string& newHash);
5457
virtual void removeAuthToken(const Wt::Auth::User& user,
5558
const std::string& hash);
5659
virtual Wt::Auth::User findWithAuthToken(const std::string& hash) const;

examples/widgetgallery/CMakeLists.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,6 @@ IF (HAVE_HARU)
3939
INCLUDE_DIRECTORIES(${HARU_INCLUDE_DIRS})
4040
ENDIF(HAVE_HARU)
4141

42-
IF(CMAKE_COMPILER_IS_GNUCXX)
43-
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
44-
ENDIF(CMAKE_COMPILER_IS_GNUCXX)
45-
4642
#
4743
# If you have Wt installed somehwere, you should use the
4844
# installed Wt header files for your own Wt projects.

0 commit comments

Comments
 (0)