[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdepimlibs/kholidays
From:       John Layt <john () layt ! net>
Date:       2010-05-28 18:28:38
Message-ID: 20100528182838.E4189AC8C1 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1131705 by jlayt:

Now that the new holiday data files are all in place, we can turn the old file
parser off and fully switch to the new parser.

This includes removing the parallel testing between the old and new parser
which makes the build a lot cleaner as we don't have to try link direct to the
private parser classes.  This caused problems with the Windows build when I
first implemented it early in 4.5, so hopefully this doesn't mess that up.

I'm leaving the old paser code in svn for now, but it will eventually be
deleted.

CCMAIL: romain@kdab.net



 M  +4 -4      CMakeLists.txt  
 M  +6 -6      holidayregion.cpp  
 M  +1 -1      holidays/CMakeLists.txt  
 M  +1 -2      parsers/plan1/parseholiday.c  
 M  +0 -16     tests/CMakeLists.txt  
 M  +4 -0      tests/testholidayregion.cpp  
 D             tests/testparseholiday.cpp  
 D             tests/testparseholiday.h  


--- trunk/KDE/kdepimlibs/kholidays/CMakeLists.txt #1131704:1131705
@@ -5,7 +5,7 @@
 add_subdirectory(holidays)
 add_subdirectory(tests)
 
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}/parsers/plan1)
+include_directories(${CMAKE_CURRENT_SOURCE_DIR}/parsers/plan2)
 
 check_include_files(err.h HAVE_ERR_H)
 check_include_files(sys/cdefs.h HAVE_SYS_CDEFS_H)
@@ -20,9 +20,9 @@
   lunarphase.cpp
   zodiac.cpp
   parsers/holidayparserdriver.cpp
-  parsers/plan1/holidayparserdriverplanold.cpp
-  parsers/plan1/scanholiday.c
-  parsers/plan1/parseholiday.c
+  parsers/plan2/holidayparserdriverplan.cpp
+  parsers/plan2/holidayparserplan.cpp
+  parsers/plan2/holidayscannerplan.cpp
 )
 
 kde4_add_library(kholidays SHARED ${kholidays_LIB_SRCS})
--- trunk/KDE/kdepimlibs/kholidays/holidayregion.cpp #1131704:1131705
@@ -34,7 +34,7 @@
 #include <KDebug>
 
 #include "holiday_p.h"
-#include "parsers/plan1/holidayparserdriverplanold_p.h"
+#include "parsers/plan2/holidayparserdriverplan_p.h"
 
 using namespace KHolidays;
 
@@ -48,7 +48,7 @@
         if ( mRegionCode.length() == 2 ) { //Backwards compatible mode for old \
location code  mLocation = mRegionCode;
           QStringList locationFiles = KGlobal::dirs()->findAllResources( "data",
-                                                                         \
"libkholidays/plan1/holiday_" + mLocation + "*", +                                    \
                "libkholidays/plan2/holiday_" + mLocation + "*",
                                                                          \
KStandardDirs::NoDuplicates );  if ( locationFiles.count() > 0 ) {
             mRegionCode = locationFiles.at( 0 ).mid( locationFiles.at( 0 \
).lastIndexOf( "holiday_" ) + 8 ); @@ -56,12 +56,12 @@
         } else {
           mLocation = mRegionCode.left( 2 );
         }
-        mHolidayFile = KStandardDirs::locate( "data", "libkholidays/plan1/holiday_" \
+ mRegionCode ); +        mHolidayFile = KStandardDirs::locate( "data", \
"libkholidays/plan2/holiday_" + mRegionCode );  if ( mHolidayFile.isEmpty() ) {
           mRegionCode.clear();
           mLocation.clear();
         } else {
-          mDriver = new HolidayParserDriverPlanOld( mHolidayFile );
+          mDriver = new HolidayParserDriverPlan( mHolidayFile );
         }
       }
     }
@@ -90,7 +90,7 @@
 QStringList HolidayRegion::locations()
 {
   const QStringList files =
-    KGlobal::dirs()->findAllResources( "data", "libkholidays/plan1/holiday_*",
+    KGlobal::dirs()->findAllResources( "data", "libkholidays/plan2/holiday_*",
                                        KStandardDirs::NoDuplicates );
 
   QStringList locations;
@@ -111,7 +111,7 @@
 QStringList HolidayRegion::regions()
 {
   const QStringList files =
-    KGlobal::dirs()->findAllResources( "data", "libkholidays/plan1/holiday_*",
+    KGlobal::dirs()->findAllResources( "data", "libkholidays/plan2/holiday_*",
                                        KStandardDirs::NoDuplicates );
 
   QStringList regions;
--- trunk/KDE/kdepimlibs/kholidays/holidays/CMakeLists.txt #1131704:1131705
@@ -1 +1 @@
-install( DIRECTORY plan1 DESTINATION ${DATA_INSTALL_DIR}/libkholidays PATTERN ".svn" \
EXCLUDE PATTERN ".git" EXCLUDE ) +install( DIRECTORY plan2 DESTINATION \
${DATA_INSTALL_DIR}/libkholidays PATTERN ".svn" EXCLUDE PATTERN ".git" EXCLUDE \
                PATTERN "*~" EXCLUDE)
--- trunk/KDE/kdepimlibs/kholidays/parsers/plan1/parseholiday.c #1131704:1131705
@@ -155,7 +155,6 @@
  */
 
 #include <config-kholidays.h>
-#include "kholidays_export.h"
 
 #include <stdio.h>
 #include <unistd.h>
@@ -185,7 +184,7 @@
 #define	BEFORE		-1
 #define AFTER		-2
 /**** Public forward declarations  ****/
-KHOLIDAYS_EXPORT char *parse_holidays(const char *holidays, int year, short force);
+char *parse_holidays(const char *holidays, int year, short force);
 
 /**** Private forward declarations ****/
 extern int       kcallex(void);          /* external lexical analyzer */
--- trunk/KDE/kdepimlibs/kholidays/tests/CMakeLists.txt #1131704:1131705
@@ -41,22 +41,6 @@
 
 ########### next target ###############
 
-#set( EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/tests/ )
-
-set(testparseholiday_SRCS
-    testparseholiday.cpp
-    ../parsers/holidayparserdriver.cpp
-    ../parsers/plan1/holidayparserdriverplanold.cpp
-    ../parsers/plan2/holidayparserplan.cpp
-    ../parsers/plan2/holidayscannerplan.cpp
-    ../parsers/plan2/holidayparserdriverplan.cpp)
-
-kde4_add_unit_test(testparseholiday TESTNAME kholidays-testparseholiday \
                ${testparseholiday_SRCS})
-
-target_link_libraries(testparseholiday ${KDE4_KDECORE_LIBS} kholidays \
                ${QT_QTTEST_LIBRARY} ${QT_QTGUI_LIBRARY})
-
-########### next target ###############
-
 #set(testholiday_SRCS testholiday.cpp )
 
 
--- trunk/KDE/kdepimlibs/kholidays/tests/testholidayregion.cpp #1131704:1131705
@@ -34,12 +34,16 @@
 {
     KHolidays::HolidayRegion region( regionCode );
 
+    if ( region.isValid() ) {
     kDebug() << "This regionCode = " << region.regionCode();
     kDebug() << "Is valid? = " << region.isValid();
     kDebug() << "Country code = " << region.countryCode();
     kDebug() << "Language code = " << region.languageCode();
     kDebug() << "Name = " << region.name();
     kDebug() << "Description = " << region.description();
+    } else {
+      kDebug() << "Not Valid!";
+    }
     kDebug() << "";
 }
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic