[Kita-svn] [2552] - add config.h.cmake to define VERSION

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2009年 8月 11日 (火) 19:28:08 JST


Revision: 2552
          http://sourceforge.jp/projects/kita/svn/view?view=rev&revision=2552
Author:   nogu
Date:     2009-08-11 19:28:08 +0900 (Tue, 11 Aug 2009)

Log Message:
-----------
- add config.h.cmake to define VERSION
- don't hardcode a version number
- remove kita.lsm
- pass KIO::Reload and KIO::HideProgressInfo to KIO::get
- kita.spec.cmake instead of kita.spec

Modified Paths:
--------------
    kita/branches/KITA-KDE4/CMakeLists.txt
    kita/branches/KITA-KDE4/kita/src/libkita/access.cpp
    kita/branches/KITA-KDE4/kita/src/libkita/account.cpp
    kita/branches/KITA-KDE4/kita/src/libkita/boardmanager.cpp
    kita/branches/KITA-KDE4/kita/src/main.cpp

Added Paths:
-----------
    kita/branches/KITA-KDE4/config.h.cmake
    kita/branches/KITA-KDE4/kita.spec.cmake

Removed Paths:
-------------
    kita/branches/KITA-KDE4/kita/src/kita.lsm
    kita/branches/KITA-KDE4/kita.spec

Modified: kita/branches/KITA-KDE4/CMakeLists.txt
===================================================================
--- kita/branches/KITA-KDE4/CMakeLists.txt	2009-08-10 21:53:53 UTC (rev 2551)
+++ kita/branches/KITA-KDE4/CMakeLists.txt	2009-08-11 10:28:08 UTC (rev 2552)
@@ -1,4 +1,5 @@
 project(kita)
+set(VERSION 0.200.0)
 
 find_package(KDE4 REQUIRED)
 
@@ -8,4 +9,8 @@
 
 include(MacroLibrary)
 
+configure_file(kita.spec.cmake ${CMAKE_CURRENT_BINARY_DIR}/kita.spec)
+configure_file(config.h.cmake
+        ${CMAKE_CURRENT_BINARY_DIR}/kita/src/libkita/config.h)
+
 add_subdirectory(kita)

Added: kita/branches/KITA-KDE4/config.h.cmake
===================================================================
--- kita/branches/KITA-KDE4/config.h.cmake	                        (rev 0)
+++ kita/branches/KITA-KDE4/config.h.cmake	2009-08-11 10:28:08 UTC (rev 2552)
@@ -0,0 +1,6 @@
+#ifndef CONFIG_H
+#define CONFIG_H
+
+#cmakedefine VERSION "@VERSION@"
+
+#endif

Deleted: kita/branches/KITA-KDE4/kita/src/kita.lsm
===================================================================
--- kita/branches/KITA-KDE4/kita/src/kita.lsm	2009-08-10 21:53:53 UTC (rev 2551)
+++ kita/branches/KITA-KDE4/kita/src/kita.lsm	2009-08-11 10:28:08 UTC (rev 2552)
@@ -1,16 +0,0 @@
-Begin3
-Title:          Kita -- 2ch client for KDE
-Version:        0.200.0
-Entered-date:   
-Description:    
-Keywords:       KDE3 Qt
-Author:         Hideki Ikemoto <ikemo****@users*****>
-Maintained-by:  Hideki Ikemoto <ikemo****@users*****>
-Home-page:      
-Alternate-site: 
-Primary-site:   ftp://ftp.kde.org/pub/kde/unstable/apps/utils
-                xxxxxx  kita-0.200.0.tar.gz
-                xxx     kita-0.200.0.lsm
-Platform:       Linux. Needs KDE 3.x
-Copying-policy: GPL
-End

Modified: kita/branches/KITA-KDE4/kita/src/libkita/access.cpp
===================================================================
--- kita/branches/KITA-KDE4/kita/src/libkita/access.cpp	2009-08-10 21:53:53 UTC (rev 2551)
+++ kita/branches/KITA-KDE4/kita/src/libkita/access.cpp	2009-08-11 10:28:08 UTC (rev 2552)
@@ -24,6 +24,7 @@
 #include "account.h"
 #include "boardmanager.h"
 #include "cache.h"
+#include "config.h"
 #include "flashcgi.h"
 #include "jbbs.h"
 #include "kita_misc.h"
@@ -147,13 +148,14 @@
     }
 
     /* set UserAgent */
-    const QString useragent = QString("Monazilla/1.00 (Kita/%1)").arg("0.200.0"); // TODO
+    const QString useragent = QString("Monazilla/1.00 (Kita/%1)").arg(VERSION);
     KIO::SlaveConfig::self() ->setConfigData("http",
             KUrl(getUrl).host(),
             "UserAgent", useragent);
 
     /* create new job */
-    KIO::TransferJob* job = KIO::get(getUrl);
+    KIO::TransferJob* job
+        = KIO::get(getUrl, KIO::Reload, KIO::HideProgressInfo);
     m_currentJob = job;
 
     connect(job, SIGNAL(data(KIO::Job*, const QByteArray&)),
@@ -212,8 +214,8 @@
     /* check if received data is invalid (or broken). */
     if ((m_dataSize > 0 && responseCode() != 206)
             || (m_firstReceive && data_tmp[ 0 ] != '\n')
-            || (m_dataSize == 0 && responseCode() != 200)
-      ) m_invalidDataReceived = true;
+            || (m_dataSize == 0 && responseCode() != 200))
+        m_invalidDataReceived = true;
 
     if (m_invalidDataReceived) return ;
 
@@ -357,7 +359,6 @@
 int Access::responseCode()
 {
     if (m_currentJob) m_header = m_currentJob->queryMetaData("HTTP-Headers");
-    //if (m_header.isEmpty()) return 200;
     // parse HTTP headers
     QStringList headerList = m_header.split('\n');
     QRegExp regexp("HTTP/1\\.[01] ([0-9]+) .*");
@@ -398,9 +399,10 @@
     KIO::SlaveConfig::self() ->setConfigData("http",
             KUrl(getUrl).host(),
             "UserAgent",
-            QString("Monazilla/1.00 (Kita/%1)").arg("0.200.0")); // TODO
+            QString("Monazilla/1.00 (Kita/%1)").arg(VERSION));
 
-    KIO::TransferJob* job = KIO::get(kgetUrl, KIO::Reload, KIO::HideProgressInfo);
+    KIO::TransferJob* job
+        = KIO::get(kgetUrl, KIO::Reload, KIO::HideProgressInfo);
     m_currentJob = job;
 
     connect(job, SIGNAL(data(KIO::Job*, const QByteArray&)),

Modified: kita/branches/KITA-KDE4/kita/src/libkita/account.cpp
===================================================================
--- kita/branches/KITA-KDE4/kita/src/libkita/account.cpp	2009-08-10 21:53:53 UTC (rev 2551)
+++ kita/branches/KITA-KDE4/kita/src/libkita/account.cpp	2009-08-11 10:28:08 UTC (rev 2552)
@@ -17,6 +17,8 @@
 #include <kio/jobuidelegate.h>
 #include <kio/slaveconfig.h>
 
+#include "config.h"
+
 using namespace Kita;
 
 Account* Account::instance = 0;
@@ -58,7 +60,7 @@
              SLOT(slotReceiveData(KIO::Job*, const QByteArray&)));
     connect(m_job, SIGNAL(result(KIO::Job*)), SLOT(slotResult(KIO::Job*)));
     m_job->addMetaData("customHTTPHeader",
-                        QString("X-2ch-UA: Kita/%1").arg("0.200.0"));
+                        QString("X-2ch-UA: Kita/%1").arg(VERSION));
     m_job->addMetaData("content-type",
                         "Content-Type: application/x-www-form-urlencoded");
 

Modified: kita/branches/KITA-KDE4/kita/src/libkita/boardmanager.cpp
===================================================================
--- kita/branches/KITA-KDE4/kita/src/libkita/boardmanager.cpp	2009-08-10 21:53:53 UTC (rev 2551)
+++ kita/branches/KITA-KDE4/kita/src/libkita/boardmanager.cpp	2009-08-11 10:28:08 UTC (rev 2552)
@@ -22,6 +22,7 @@
 #include <kio/slaveconfig.h>
 
 #include "cache.h"
+#include "config.h"
 #include "favoriteboards.h"
 #include "favoritethreads.h"
 #include "kita_misc.h"
@@ -465,7 +466,7 @@
         KIO::SlaveConfig::self() ->setConfigData("http",
                 url.host() ,
                 "UserAgent",
-                QString("Monazilla/1.00 (Kita/%1)").arg("0.200.0"));
+                QString("Monazilla/1.00 (Kita/%1)").arg(VERSION));
         QString subjectPath = cache.getSubjectPath();
         KIO::NetAccess::download(subjectUrl(url), subjectPath, 0);
     }

Modified: kita/branches/KITA-KDE4/kita/src/main.cpp
===================================================================
--- kita/branches/KITA-KDE4/kita/src/main.cpp	2009-08-10 21:53:53 UTC (rev 2551)
+++ kita/branches/KITA-KDE4/kita/src/main.cpp	2009-08-11 10:28:08 UTC (rev 2552)
@@ -16,20 +16,19 @@
 #include <kcmdlineargs.h>
 #include <kuniqueapplication.h>
 
+#include "libkita/config.h"
 #include "libkita/globalconfig.h"
 
 static const char *description =
     I18N_NOOP("Kita - 2ch client for KDE");
 
-static const char *version = "0.200.0"; // TODO
-
 using namespace Kita;
 
 int main(int argc, char **argv)
 {
     // for code page 932 with NEC special characters
     setenv("UNICODEMAP_JP", "cp932,nec-vdc", 1);
-    KAboutData about("kita", "kita", ki18n("Kita"), version, ki18n(description),
+    KAboutData about("kita", "kita", ki18n("Kita"), VERSION, ki18n(description),
         KAboutData::License_GPL, ki18n("(C) 2003-2009 Kita Developers"),
         KLocalizedString(), QByteArray(), "ikemo****@users*****");
     about.addAuthor(ki18n("Hideki Ikemoto"), ki18n("maintainer, initial code"),

Deleted: kita/branches/KITA-KDE4/kita.spec
===================================================================
--- kita/branches/KITA-KDE4/kita.spec	2009-08-10 21:53:53 UTC (rev 2551)
+++ kita/branches/KITA-KDE4/kita.spec	2009-08-11 10:28:08 UTC (rev 2552)
@@ -1,107 +0,0 @@
-Summary: 2ch client for KDE
-Summary(ja): KDE 用 2ch ブラウザ
-Name: kita
-Version: 0.200.0
-Release: 1
-URL: http://sourceforge.jp/projects/kita/
-Source: kita-%{version}.tar.bz2
-License: GPL
-Group: Application/Internet
-BuildRoot: %{_tmppath}/%{name}-%{version}-root
-%if 0%{?suse_version}
-BuildRequires: libkde4-devel
-%kde4_runtime_requires
-%else
-BuildRequires: gcc-c++
-BuildRequires: kdelibs-devel >= 4.2
-Requires: kdelibs >= 4.2
-%endif
-
-%description
-Kita is a 2ch client for KDE.
-
-%description -l ja
-Kita は KDE 用 2ch ブラウザです。
-
-%prep
-%setup -q
-
-%build
-%if 0%{?suse_version}
-%cmake_kde4 -d build
-%make_jobs
-%else
-mkdir -p %{_target_platform}
-pushd %{_target_platform}
-%cmake_kde4 ..
-popd
-make %{?_smp_mflags} -C %{_target_platform}
-%endif
-
-%install
-%if 0%{?suse_version}
-cd build
-%makeinstall
-%else
-make install DESTDIR=%{buildroot} -C %{_target_platform}
-%endif
-strip --strip-unneeded %{buildroot}/%{_libdir}/lib%{name}*.so*.*.*
-strip %{buildroot}/%{_bindir}/%{name}
-rm %{buildroot}/%{_libdir}/lib%{name}*.so
-
-%if 0%{?suse_version}
-%suse_update_desktop_file %{name}
-%kde_post_install
-%endif
-
-%clean
-rm -rf %{buildroot}
-
-%post -p /sbin/ldconfig
-%postun -p /sbin/ldconfig
-%files
-%defattr(-, root, root)
-#%doc AUTHORS COPYING ChangeLog NEWS README README.2ch TODO
-%{_bindir}/%{name}
-%{_libdir}/lib%{name}*.so*
-%{_datadir}/applications/kde4/%{name}.desktop
-%dir %{_datadir}/kde4/apps/%{name}
-%{_datadir}/kde4/apps/%{name}/*ui.rc
-%if 0%{?suse_version}
-%{_datadir}/kde4/config.kcfg/*.kcfg
-%else
-%{_kde4_datadir}/config.kcfg/*.kcfg
-%endif
-%{_datadir}/icons/hicolor/16x16/actions/*.png
-%{_datadir}/icons/hicolor/48x48/apps/%{name}.png
-%lang(ja) %{_datadir}/locale/ja/LC_MESSAGES/%{name}.mo
-%if 0%{?suse_version}
-%dir %{_datadir}/doc/kde/HTML/en/%{name}
-%{_datadir}/doc/kde/HTML/en/%{name}/common
-%{_datadir}/doc/kde/HTML/en/%{name}/index.cache.bz2
-%{_datadir}/doc/kde/HTML/en/%{name}/index.docbook
-%else
-%dir %{_kde4_docdir}/HTML/en/%{name}
-%{_kde4_docdir}/HTML/en/%{name}/common
-%{_kde4_docdir}/HTML/en/%{name}/index.cache.bz2
-%{_kde4_docdir}/HTML/en/%{name}/index.docbook
-%endif
-
-%changelog
-* Sun Nov 21 2004 Hideki Ikemoto<ikemo****@users*****> - 0.173.0 
-- remove kitapart/kita*ui.rc
-
-* Sat Oct 07 2004 Hideki Ikemoto<ikemo****@users*****>
-- set %%{_prefix} if SuSE
-
-* Sat May 15 2004 Hideki Ikemoto<ikemo****@users*****>
-- add 'Serial' field (comment)
-
-* Sat Dec 13 2003 Hideki Ikemoto<ikemo****@users*****>
-- don't use %%configure
-
-* Mon Oct 13 2003 Hideki Ikemoto<ikemo****@users*****>
-- add files
-
-* Wed Mar 03 2003 Hideki Ikemoto<ikemo****@users*****>
-- initial release.

Copied: kita/branches/KITA-KDE4/kita.spec.cmake (from rev 2528, kita/branches/KITA-KDE4/kita.spec)
===================================================================
--- kita/branches/KITA-KDE4/kita.spec.cmake	                        (rev 0)
+++ kita/branches/KITA-KDE4/kita.spec.cmake	2009-08-11 10:28:08 UTC (rev 2552)
@@ -0,0 +1,107 @@
+Summary: 2ch client for KDE
+Summary(ja): KDE 用 2ch ブラウザ
+Name: kita
+Version: @VERSION@
+Release: 1
+URL: http://sourceforge.jp/projects/kita/
+Source: kita-%{version}.tar.bz2
+License: GPL
+Group: Application/Internet
+BuildRoot: %{_tmppath}/%{name}-%{version}-root
+%if 0%{?suse_version}
+BuildRequires: libkde4-devel
+%kde4_runtime_requires
+%else
+BuildRequires: gcc-c++
+BuildRequires: kdelibs-devel >= 4.2
+Requires: kdelibs >= 4.2
+%endif
+
+%description
+Kita is a 2ch client for KDE.
+
+%description -l ja
+Kita は KDE 用 2ch ブラウザです。
+
+%prep
+%setup -q
+
+%build
+%if 0%{?suse_version}
+%cmake_kde4 -d build
+%make_jobs
+%else
+mkdir -p %{_target_platform}
+pushd %{_target_platform}
+%cmake_kde4 ..
+popd
+make %{?_smp_mflags} -C %{_target_platform}
+%endif
+
+%install
+%if 0%{?suse_version}
+cd build
+%makeinstall
+%else
+make install DESTDIR=%{buildroot} -C %{_target_platform}
+%endif
+strip --strip-unneeded %{buildroot}/%{_libdir}/lib%{name}*.so*.*.*
+strip %{buildroot}/%{_bindir}/%{name}
+rm %{buildroot}/%{_libdir}/lib%{name}*.so
+
+%if 0%{?suse_version}
+%suse_update_desktop_file %{name}
+%kde_post_install
+%endif
+
+%clean
+rm -rf %{buildroot}
+
+%post -p /sbin/ldconfig
+%postun -p /sbin/ldconfig
+%files
+%defattr(-, root, root)
+#%doc AUTHORS COPYING ChangeLog NEWS README README.2ch TODO
+%{_bindir}/%{name}
+%{_libdir}/lib%{name}*.so*
+%{_datadir}/applications/kde4/%{name}.desktop
+%dir %{_datadir}/kde4/apps/%{name}
+%{_datadir}/kde4/apps/%{name}/*ui.rc
+%if 0%{?suse_version}
+%{_datadir}/kde4/config.kcfg/*.kcfg
+%else
+%{_kde4_datadir}/config.kcfg/*.kcfg
+%endif
+%{_datadir}/icons/hicolor/16x16/actions/*.png
+%{_datadir}/icons/hicolor/48x48/apps/%{name}.png
+%lang(ja) %{_datadir}/locale/ja/LC_MESSAGES/%{name}.mo
+%if 0%{?suse_version}
+%dir %{_datadir}/doc/kde/HTML/en/%{name}
+%{_datadir}/doc/kde/HTML/en/%{name}/common
+%{_datadir}/doc/kde/HTML/en/%{name}/index.cache.bz2
+%{_datadir}/doc/kde/HTML/en/%{name}/index.docbook
+%else
+%dir %{_kde4_docdir}/HTML/en/%{name}
+%{_kde4_docdir}/HTML/en/%{name}/common
+%{_kde4_docdir}/HTML/en/%{name}/index.cache.bz2
+%{_kde4_docdir}/HTML/en/%{name}/index.docbook
+%endif
+
+%changelog
+* Sun Nov 21 2004 Hideki Ikemoto<ikemo****@users*****> - 0.173.0 
+- remove kitapart/kita*ui.rc
+
+* Sat Oct 07 2004 Hideki Ikemoto<ikemo****@users*****>
+- set %%{_prefix} if SuSE
+
+* Sat May 15 2004 Hideki Ikemoto<ikemo****@users*****>
+- add 'Serial' field (comment)
+
+* Sat Dec 13 2003 Hideki Ikemoto<ikemo****@users*****>
+- don't use %%configure
+
+* Mon Oct 13 2003 Hideki Ikemoto<ikemo****@users*****>
+- add files
+
+* Wed Mar 03 2003 Hideki Ikemoto<ikemo****@users*****>
+- initial release.


Property changes on: kita/branches/KITA-KDE4/kita.spec.cmake
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:mergeinfo
   + 
Added: svn:eol-style
   + native




Kita-svn メーリングリストの案内
Back to archive index