• R/O
  • SSH
  • HTTPS

kita: Commit


Commit MetaInfo

Revision2552 (tree)
Time2009-08-11 19:28:08
Authornogu

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

Change Summary

Incremental Difference

--- kita/branches/KITA-KDE4/kita.spec (revision 2551)
+++ kita/branches/KITA-KDE4/kita.spec (nonexistent)
@@ -1,107 +0,0 @@
1-Summary: 2ch client for KDE
2-Summary(ja): KDE 用 2ch ブラウザ
3-Name: kita
4-Version: 0.200.0
5-Release: 1
6-URL: http://sourceforge.jp/projects/kita/
7-Source: kita-%{version}.tar.bz2
8-License: GPL
9-Group: Application/Internet
10-BuildRoot: %{_tmppath}/%{name}-%{version}-root
11-%if 0%{?suse_version}
12-BuildRequires: libkde4-devel
13-%kde4_runtime_requires
14-%else
15-BuildRequires: gcc-c++
16-BuildRequires: kdelibs-devel >= 4.2
17-Requires: kdelibs >= 4.2
18-%endif
19-
20-%description
21-Kita is a 2ch client for KDE.
22-
23-%description -l ja
24-Kita は KDE 用 2ch ブラウザです。
25-
26-%prep
27-%setup -q
28-
29-%build
30-%if 0%{?suse_version}
31-%cmake_kde4 -d build
32-%make_jobs
33-%else
34-mkdir -p %{_target_platform}
35-pushd %{_target_platform}
36-%cmake_kde4 ..
37-popd
38-make %{?_smp_mflags} -C %{_target_platform}
39-%endif
40-
41-%install
42-%if 0%{?suse_version}
43-cd build
44-%makeinstall
45-%else
46-make install DESTDIR=%{buildroot} -C %{_target_platform}
47-%endif
48-strip --strip-unneeded %{buildroot}/%{_libdir}/lib%{name}*.so*.*.*
49-strip %{buildroot}/%{_bindir}/%{name}
50-rm %{buildroot}/%{_libdir}/lib%{name}*.so
51-
52-%if 0%{?suse_version}
53-%suse_update_desktop_file %{name}
54-%kde_post_install
55-%endif
56-
57-%clean
58-rm -rf %{buildroot}
59-
60-%post -p /sbin/ldconfig
61-%postun -p /sbin/ldconfig
62-%files
63-%defattr(-, root, root)
64-#%doc AUTHORS COPYING ChangeLog NEWS README README.2ch TODO
65-%{_bindir}/%{name}
66-%{_libdir}/lib%{name}*.so*
67-%{_datadir}/applications/kde4/%{name}.desktop
68-%dir %{_datadir}/kde4/apps/%{name}
69-%{_datadir}/kde4/apps/%{name}/*ui.rc
70-%if 0%{?suse_version}
71-%{_datadir}/kde4/config.kcfg/*.kcfg
72-%else
73-%{_kde4_datadir}/config.kcfg/*.kcfg
74-%endif
75-%{_datadir}/icons/hicolor/16x16/actions/*.png
76-%{_datadir}/icons/hicolor/48x48/apps/%{name}.png
77-%lang(ja) %{_datadir}/locale/ja/LC_MESSAGES/%{name}.mo
78-%if 0%{?suse_version}
79-%dir %{_datadir}/doc/kde/HTML/en/%{name}
80-%{_datadir}/doc/kde/HTML/en/%{name}/common
81-%{_datadir}/doc/kde/HTML/en/%{name}/index.cache.bz2
82-%{_datadir}/doc/kde/HTML/en/%{name}/index.docbook
83-%else
84-%dir %{_kde4_docdir}/HTML/en/%{name}
85-%{_kde4_docdir}/HTML/en/%{name}/common
86-%{_kde4_docdir}/HTML/en/%{name}/index.cache.bz2
87-%{_kde4_docdir}/HTML/en/%{name}/index.docbook
88-%endif
89-
90-%changelog
91-* Sun Nov 21 2004 Hideki Ikemoto<ikemo@users.sourceforge.jp> - 0.173.0
92-- remove kitapart/kita*ui.rc
93-
94-* Sat Oct 07 2004 Hideki Ikemoto<ikemo@users.sourceforge.jp>
95-- set %%{_prefix} if SuSE
96-
97-* Sat May 15 2004 Hideki Ikemoto<ikemo@users.sourceforge.jp>
98-- add 'Serial' field (comment)
99-
100-* Sat Dec 13 2003 Hideki Ikemoto<ikemo@users.sourceforge.jp>
101-- don't use %%configure
102-
103-* Mon Oct 13 2003 Hideki Ikemoto<ikemo@users.sourceforge.jp>
104-- add files
105-
106-* Wed Mar 03 2003 Hideki Ikemoto<ikemo@users.sourceforge.jp>
107-- initial release.
Deleted: svn:eol-style
## -1 +0,0 ##
-native
\ No newline at end of property
Deleted: svn:keywords
## -1 +0,0 ##
-Author Date Id Revision
\ No newline at end of property
--- kita/branches/KITA-KDE4/kita/src/main.cpp (revision 2551)
+++ kita/branches/KITA-KDE4/kita/src/main.cpp (revision 2552)
@@ -16,13 +16,12 @@
1616 #include <kcmdlineargs.h>
1717 #include <kuniqueapplication.h>
1818
19+#include "libkita/config.h"
1920 #include "libkita/globalconfig.h"
2021
2122 static const char *description =
2223 I18N_NOOP("Kita - 2ch client for KDE");
2324
24-static const char *version = "0.200.0"; // TODO
25-
2625 using namespace Kita;
2726
2827 int main(int argc, char **argv)
@@ -29,7 +28,7 @@
2928 {
3029 // for code page 932 with NEC special characters
3130 setenv("UNICODEMAP_JP", "cp932,nec-vdc", 1);
32- KAboutData about("kita", "kita", ki18n("Kita"), version, ki18n(description),
31+ KAboutData about("kita", "kita", ki18n("Kita"), VERSION, ki18n(description),
3332 KAboutData::License_GPL, ki18n("(C) 2003-2009 Kita Developers"),
3433 KLocalizedString(), QByteArray(), "ikemo@users.sourceforge.jp");
3534 about.addAuthor(ki18n("Hideki Ikemoto"), ki18n("maintainer, initial code"),
--- kita/branches/KITA-KDE4/kita/src/libkita/access.cpp (revision 2551)
+++ kita/branches/KITA-KDE4/kita/src/libkita/access.cpp (revision 2552)
@@ -24,6 +24,7 @@
2424 #include "account.h"
2525 #include "boardmanager.h"
2626 #include "cache.h"
27+#include "config.h"
2728 #include "flashcgi.h"
2829 #include "jbbs.h"
2930 #include "kita_misc.h"
@@ -147,13 +148,14 @@
147148 }
148149
149150 /* set UserAgent */
150- const QString useragent = QString("Monazilla/1.00 (Kita/%1)").arg("0.200.0"); // TODO
151+ const QString useragent = QString("Monazilla/1.00 (Kita/%1)").arg(VERSION);
151152 KIO::SlaveConfig::self() ->setConfigData("http",
152153 KUrl(getUrl).host(),
153154 "UserAgent", useragent);
154155
155156 /* create new job */
156- KIO::TransferJob* job = KIO::get(getUrl);
157+ KIO::TransferJob* job
158+ = KIO::get(getUrl, KIO::Reload, KIO::HideProgressInfo);
157159 m_currentJob = job;
158160
159161 connect(job, SIGNAL(data(KIO::Job*, const QByteArray&)),
@@ -212,8 +214,8 @@
212214 /* check if received data is invalid (or broken). */
213215 if ((m_dataSize > 0 && responseCode() != 206)
214216 || (m_firstReceive && data_tmp[ 0 ] != '\n')
215- || (m_dataSize == 0 && responseCode() != 200)
216- ) m_invalidDataReceived = true;
217+ || (m_dataSize == 0 && responseCode() != 200))
218+ m_invalidDataReceived = true;
217219
218220 if (m_invalidDataReceived) return ;
219221
@@ -357,7 +359,6 @@
357359 int Access::responseCode()
358360 {
359361 if (m_currentJob) m_header = m_currentJob->queryMetaData("HTTP-Headers");
360- //if (m_header.isEmpty()) return 200;
361362 // parse HTTP headers
362363 QStringList headerList = m_header.split('\n');
363364 QRegExp regexp("HTTP/1\\.[01] ([0-9]+) .*");
@@ -398,9 +399,10 @@
398399 KIO::SlaveConfig::self() ->setConfigData("http",
399400 KUrl(getUrl).host(),
400401 "UserAgent",
401- QString("Monazilla/1.00 (Kita/%1)").arg("0.200.0")); // TODO
402+ QString("Monazilla/1.00 (Kita/%1)").arg(VERSION));
402403
403- KIO::TransferJob* job = KIO::get(kgetUrl, KIO::Reload, KIO::HideProgressInfo);
404+ KIO::TransferJob* job
405+ = KIO::get(kgetUrl, KIO::Reload, KIO::HideProgressInfo);
404406 m_currentJob = job;
405407
406408 connect(job, SIGNAL(data(KIO::Job*, const QByteArray&)),
--- kita/branches/KITA-KDE4/kita/src/libkita/boardmanager.cpp (revision 2551)
+++ kita/branches/KITA-KDE4/kita/src/libkita/boardmanager.cpp (revision 2552)
@@ -22,6 +22,7 @@
2222 #include <kio/slaveconfig.h>
2323
2424 #include "cache.h"
25+#include "config.h"
2526 #include "favoriteboards.h"
2627 #include "favoritethreads.h"
2728 #include "kita_misc.h"
@@ -465,7 +466,7 @@
465466 KIO::SlaveConfig::self() ->setConfigData("http",
466467 url.host() ,
467468 "UserAgent",
468- QString("Monazilla/1.00 (Kita/%1)").arg("0.200.0"));
469+ QString("Monazilla/1.00 (Kita/%1)").arg(VERSION));
469470 QString subjectPath = cache.getSubjectPath();
470471 KIO::NetAccess::download(subjectUrl(url), subjectPath, 0);
471472 }
--- kita/branches/KITA-KDE4/kita/src/libkita/account.cpp (revision 2551)
+++ kita/branches/KITA-KDE4/kita/src/libkita/account.cpp (revision 2552)
@@ -17,6 +17,8 @@
1717 #include <kio/jobuidelegate.h>
1818 #include <kio/slaveconfig.h>
1919
20+#include "config.h"
21+
2022 using namespace Kita;
2123
2224 Account* Account::instance = 0;
@@ -58,7 +60,7 @@
5860 SLOT(slotReceiveData(KIO::Job*, const QByteArray&)));
5961 connect(m_job, SIGNAL(result(KIO::Job*)), SLOT(slotResult(KIO::Job*)));
6062 m_job->addMetaData("customHTTPHeader",
61- QString("X-2ch-UA: Kita/%1").arg("0.200.0"));
63+ QString("X-2ch-UA: Kita/%1").arg(VERSION));
6264 m_job->addMetaData("content-type",
6365 "Content-Type: application/x-www-form-urlencoded");
6466
--- kita/branches/KITA-KDE4/CMakeLists.txt (revision 2551)
+++ kita/branches/KITA-KDE4/CMakeLists.txt (revision 2552)
@@ -1,4 +1,5 @@
11 project(kita)
2+set(VERSION 0.200.0)
23
34 find_package(KDE4 REQUIRED)
45
@@ -8,4 +9,8 @@
89
910 include(MacroLibrary)
1011
12+configure_file(kita.spec.cmake ${CMAKE_CURRENT_BINARY_DIR}/kita.spec)
13+configure_file(config.h.cmake
14+ ${CMAKE_CURRENT_BINARY_DIR}/kita/src/libkita/config.h)
15+
1116 add_subdirectory(kita)
Show on old repository browser