修订版 | 842abcd8007644168854b4bcfee70a67e80d301b (tree) |
---|---|
时间 | 2007-11-10 21:56:37 |
作者 | ikemo <ikemo@56b1...> |
Commiter | ikemo |
remove lock object
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/kita/kita/trunk@2071 56b19765-1e22-0410-a548-a0f45d66c51a
@@ -91,9 +91,6 @@ void KitaHTMLPart::clearPart() | ||
91 | 91 | |
92 | 92 | if ( !m_datURL.isEmpty() ) { /* This part is opened. */ |
93 | 93 | |
94 | - /* don't forget to unlock previous datURL here. */ | |
95 | - Kita::DatManager::unlock( m_datURL ); | |
96 | - | |
97 | 94 | if ( m_mode == HTMLPART_MODE_MAINPART ) { /* This part is on the main thread view. */ |
98 | 95 | |
99 | 96 | /* tell Thread class that "thread is closed" */ |
@@ -137,9 +134,6 @@ bool KitaHTMLPart::setup( int mode, const KURL& url ) | ||
137 | 134 | Kita::DatManager::resetAbone( m_datURL ); |
138 | 135 | } |
139 | 136 | |
140 | - /* Lock datURL. Don't forget to unlock it later ! */ | |
141 | - Kita::DatManager::lock ( m_datURL ); | |
142 | - | |
143 | 137 | /* create HTML Document */ |
144 | 138 | createHTMLDocument(); |
145 | 139 |
@@ -83,17 +83,9 @@ DatInfo::~DatInfo() | ||
83 | 83 | /* Usually, don't call this. */ /* public */ |
84 | 84 | void DatInfo::init() |
85 | 85 | { |
86 | - QMutexLocker locker( &m_mutex ); | |
87 | - | |
88 | 86 | return initPrivate( TRUE ); |
89 | 87 | } |
90 | 88 | |
91 | -/* public */ | |
92 | -void DatInfo::wait() | |
93 | -{ | |
94 | - QMutexLocker locker( &m_mutex ); | |
95 | -} | |
96 | - | |
97 | 89 | /* Init. If loadCache = TRUE, load data from cache. */ /* private */ |
98 | 90 | void DatInfo::initPrivate( bool loadCache ) |
99 | 91 | { |
@@ -102,7 +94,6 @@ void DatInfo::initPrivate( bool loadCache ) | ||
102 | 94 | |
103 | 95 | /* init variables */ |
104 | 96 | m_broken = FALSE; |
105 | - m_lock = 0; | |
106 | 97 | m_nowLoading = FALSE; |
107 | 98 | m_lastLine = QString::null; |
108 | 99 |
@@ -176,8 +167,6 @@ void DatInfo::deleteAccessJob() | ||
176 | 167 | /* public */ |
177 | 168 | const KURL& DatInfo::url() |
178 | 169 | { |
179 | - QMutexLocker locker( &m_mutex ); | |
180 | - | |
181 | 170 | return m_datURL; |
182 | 171 | } |
183 | 172 |
@@ -196,12 +185,10 @@ const KURL& DatInfo::url() | ||
196 | 185 | DatInfo emits the finishLoad signal to the parent object */ /* public */ |
197 | 186 | bool DatInfo::updateCache( const QObject* parent ) |
198 | 187 | { |
199 | - QMutexLocker locker( &m_mutex ); | |
200 | 188 | if ( m_access == NULL ) return FALSE; |
201 | 189 | if ( m_nowLoading ) return FALSE; |
202 | 190 | |
203 | 191 | m_nowLoading = TRUE; |
204 | - m_lock++; /* By locking, DatManager can't delete this while loading. */ | |
205 | 192 | |
206 | 193 | connect( this, SIGNAL( receiveData() ), |
207 | 194 | parent, SLOT( slotReceiveData() ) ); |
@@ -309,15 +296,12 @@ void DatInfo::slotFinishLoad() | ||
309 | 296 | /* disconnect signals */ |
310 | 297 | disconnect( SIGNAL( receiveData() ) ); |
311 | 298 | disconnect( SIGNAL( finishLoad() ) ); |
312 | - | |
313 | - if ( m_lock ) m_lock--; | |
314 | 299 | } |
315 | 300 | |
316 | 301 | |
317 | 302 | /* public */ |
318 | 303 | int DatInfo::getResponseCode() |
319 | 304 | { |
320 | - QMutexLocker locker( &m_mutex ); | |
321 | 305 | if ( m_access == NULL ) return 0; |
322 | 306 | |
323 | 307 | return m_access->responseCode(); |
@@ -327,7 +311,6 @@ int DatInfo::getResponseCode() | ||
327 | 311 | /* public */ |
328 | 312 | int DatInfo::getServerTime() |
329 | 313 | { |
330 | - QMutexLocker locker( &m_mutex ); | |
331 | 314 | if ( m_access == NULL ) return 0; |
332 | 315 | |
333 | 316 | return m_access->serverTime(); |
@@ -337,7 +320,6 @@ int DatInfo::getServerTime() | ||
337 | 320 | /* public */ |
338 | 321 | bool DatInfo::deleteCache() |
339 | 322 | { |
340 | - QMutexLocker locker( &m_mutex ); | |
341 | 323 | if ( m_nowLoading ) return FALSE; |
342 | 324 | |
343 | 325 | initPrivate( FALSE ); |
@@ -349,9 +331,6 @@ bool DatInfo::deleteCache() | ||
349 | 331 | /* public */ |
350 | 332 | bool DatInfo::isLoadingNow() |
351 | 333 | { |
352 | - | |
353 | - QMutexLocker locker( &m_mutex ); | |
354 | - | |
355 | 334 | return m_nowLoading; |
356 | 335 | } |
357 | 336 |
@@ -371,39 +350,6 @@ void DatInfo::stopLoading() | ||
371 | 350 | m_access->stopJob(); |
372 | 351 | } |
373 | 352 | |
374 | - | |
375 | - | |
376 | - | |
377 | -/*---------------------------------------------------*/ | |
378 | -/* locking , unlocking functions */ | |
379 | -/* */ | |
380 | -/* If m_lock is not 0, DatManager can't delete this. */ | |
381 | -/* Don't forget to call unlock() after locking this. */ | |
382 | - | |
383 | -/* They are public */ | |
384 | - | |
385 | -void DatInfo::lock () | |
386 | -{ | |
387 | - QMutexLocker locker( &m_mutex ); | |
388 | - | |
389 | - m_lock++; | |
390 | -} | |
391 | - | |
392 | -void DatInfo::unlock() | |
393 | -{ | |
394 | - QMutexLocker locker( &m_mutex ); | |
395 | - | |
396 | - if ( m_lock ) m_lock--; | |
397 | -} | |
398 | - | |
399 | -int DatInfo::isLocked() | |
400 | -{ | |
401 | - QMutexLocker locker( &m_mutex ); | |
402 | - | |
403 | - return m_lock; | |
404 | -} | |
405 | - | |
406 | - | |
407 | 353 | /*------------------------------------------------------*/ |
408 | 354 | /* get subject, linedata, id, body, name, HTML, etc. */ |
409 | 355 |
@@ -411,7 +357,6 @@ int DatInfo::isLocked() | ||
411 | 357 | |
412 | 358 | const QString& DatInfo::getDat( int num ) |
413 | 359 | { |
414 | - QMutexLocker locker( &m_mutex ); | |
415 | 360 | if ( !parseDat( num ) ) return QString::null; |
416 | 361 | |
417 | 362 | return m_resDatVec[ num ].linestr; |
@@ -419,7 +364,6 @@ const QString& DatInfo::getDat( int num ) | ||
419 | 364 | |
420 | 365 | const QString& DatInfo::getId( int num ) |
421 | 366 | { |
422 | - QMutexLocker locker( &m_mutex ); | |
423 | 367 | if ( !parseDat( num ) ) return QString::null; |
424 | 368 | |
425 | 369 | return m_resDatVec[ num ].id; |
@@ -428,7 +372,6 @@ const QString& DatInfo::getId( int num ) | ||
428 | 372 | /* plain strings of name */ |
429 | 373 | QString DatInfo::getPlainName( int num ) |
430 | 374 | { |
431 | - QMutexLocker locker( &m_mutex ); | |
432 | 375 | if ( !parseDat( num ) ) return QString::null; |
433 | 376 | |
434 | 377 | return m_resDatVec[ num ].name; |
@@ -438,7 +381,6 @@ QString DatInfo::getPlainName( int num ) | ||
438 | 381 | /* plain strings of title */ |
439 | 382 | QString DatInfo::getPlainTitle( int num ) |
440 | 383 | { |
441 | - QMutexLocker locker( &m_mutex ); | |
442 | 384 | if ( !parseDat( num ) ) return QString::null; |
443 | 385 | |
444 | 386 | QString titleHTML; |
@@ -454,7 +396,6 @@ QString DatInfo::getPlainTitle( int num ) | ||
454 | 396 | /* plain strings of body */ |
455 | 397 | QString DatInfo::getPlainBody( int num ) |
456 | 398 | { |
457 | - QMutexLocker locker( &m_mutex ); | |
458 | 399 | if ( !parseDat( num ) ) return QString::null; |
459 | 400 | |
460 | 401 | QString retStr; |
@@ -474,7 +415,6 @@ QString DatInfo::getPlainBody( int num ) | ||
474 | 415 | |
475 | 416 | int DatInfo::getHTML( int num, bool checkAbone, QString& titleHTML, QString& bodyHTML ) |
476 | 417 | { |
477 | - QMutexLocker locker( &m_mutex ); | |
478 | 418 | return getHTMLPrivate( num, checkAbone, titleHTML, bodyHTML ); |
479 | 419 | } |
480 | 420 |
@@ -522,8 +462,6 @@ int DatInfo::getHTMLPrivate( int num, bool checkAbone, QString& titleHTML, QStri | ||
522 | 462 | return value is HTML strings */ /* public */ |
523 | 463 | QString DatInfo::getHTMLString( int startnum, int endnum, bool checkAbone ) |
524 | 464 | { |
525 | - QMutexLocker locker( &m_mutex ); | |
526 | - | |
527 | 465 | QString retHTML = QString::null; |
528 | 466 | |
529 | 467 | for ( int num = startnum; num <= endnum; num++ ) { |
@@ -540,8 +478,6 @@ QString DatInfo::getHTMLString( int startnum, int endnum, bool checkAbone ) | ||
540 | 478 | /* return HTML strings that have ID = strid. */ /* public */ |
541 | 479 | QString DatInfo::getHtmlByID( const QString& strid, int &count ) |
542 | 480 | { |
543 | - QMutexLocker locker( &m_mutex ); | |
544 | - | |
545 | 481 | QString retHTML = QString::null; |
546 | 482 | count = 0; |
547 | 483 |
@@ -597,7 +533,6 @@ void DatInfo::getHTMLofOneRes( int num, bool checkAbone, QString& html ) | ||
597 | 533 | /* Note that this function checks Abone internally. */ /* public */ |
598 | 534 | QString DatInfo::getTreeByRes( const int rootnum, int& count ) |
599 | 535 | { |
600 | - QMutexLocker locker( &m_mutex ); | |
601 | 536 | return getTreeByResPrivate( rootnum, FALSE, count ); |
602 | 537 | } |
603 | 538 |
@@ -614,7 +549,6 @@ QString DatInfo::getTreeByRes( const int rootnum, int& count ) | ||
614 | 549 | /* Note that this function checks Abone internally. */ /* public */ |
615 | 550 | QString DatInfo::getTreeByResReverse( const int rootnum, int& count ) |
616 | 551 | { |
617 | - QMutexLocker locker( &m_mutex ); | |
618 | 552 | return getTreeByResPrivate( rootnum, TRUE, count ); |
619 | 553 | } |
620 | 554 |
@@ -742,8 +676,6 @@ int DatInfo::getViewPos() | ||
742 | 676 | /* Note that this function checks Abone internally. */ /* public */ |
743 | 677 | int DatInfo::getNumByID( const QString& strid ) |
744 | 678 | { |
745 | - QMutexLocker locker( &m_mutex ); | |
746 | - | |
747 | 679 | int count = 0; |
748 | 680 | |
749 | 681 | for ( int i = 1; i <= m_thread->readNum(); i++ ) { |
@@ -761,7 +693,6 @@ int DatInfo::getNumByID( const QString& strid ) | ||
761 | 693 | /* public */ |
762 | 694 | int DatInfo::getDatSize() |
763 | 695 | { |
764 | - QMutexLocker locker( &m_mutex ); | |
765 | 696 | if ( m_access == NULL ) return 0; |
766 | 697 | |
767 | 698 | return m_access->dataSize(); |
@@ -778,16 +709,12 @@ const bool DatInfo::isResponsed( int num ) const | ||
778 | 709 | /* public */ |
779 | 710 | bool DatInfo::isResValid( int num ) |
780 | 711 | { |
781 | - QMutexLocker locker( &m_mutex ); | |
782 | - | |
783 | 712 | return parseDat( num ); |
784 | 713 | } |
785 | 714 | |
786 | 715 | /* public */ |
787 | 716 | bool DatInfo::isBroken() |
788 | 717 | { |
789 | - QMutexLocker locker( &m_mutex ); | |
790 | - | |
791 | 718 | if ( m_broken ) return m_broken; |
792 | 719 | |
793 | 720 | if ( m_access == NULL ) return FALSE; |
@@ -805,7 +732,6 @@ bool DatInfo::isBroken() | ||
805 | 732 | /* public */ |
806 | 733 | bool DatInfo::isResBroken( int num ) |
807 | 734 | { |
808 | - QMutexLocker locker( &m_mutex ); | |
809 | 735 | if ( !parseDat( num ) ) return FALSE; |
810 | 736 | |
811 | 737 | return m_resDatVec[ num ].broken; |
@@ -814,7 +740,6 @@ bool DatInfo::isResBroken( int num ) | ||
814 | 740 | /* ID = strid ? */ /* public */ |
815 | 741 | bool DatInfo::checkID( const QString& strid, int num ) |
816 | 742 | { |
817 | - QMutexLocker locker( &m_mutex ); | |
818 | 743 | if ( !parseDat( num ) ) return FALSE; |
819 | 744 | |
820 | 745 | if ( m_resDatVec[ num ].id == strid ) return TRUE; |
@@ -829,7 +754,6 @@ bool DatInfo::checkWord( QStringList& stlist, /* list of keywords */ | ||
829 | 754 | bool checkOR /* AND or OR search */ |
830 | 755 | ) |
831 | 756 | { |
832 | - QMutexLocker locker( &m_mutex ); | |
833 | 757 | if ( !parseDat( num ) ) return FALSE; |
834 | 758 | |
835 | 759 | QString str_text = m_resDatVec[ num ].bodyHTML; |
@@ -867,8 +791,6 @@ bool DatInfo::checkWord( QStringList& stlist, /* list of keywords */ | ||
867 | 791 | |
868 | 792 | void DatInfo::resetAbone() |
869 | 793 | { |
870 | - QMutexLocker locker( &m_mutex ); | |
871 | - | |
872 | 794 | return resetAbonePrivate(); |
873 | 795 | } |
874 | 796 |
@@ -889,8 +811,6 @@ void DatInfo::resetAbonePrivate() | ||
889 | 811 | |
890 | 812 | bool DatInfo::checkAbone( int num ) |
891 | 813 | { |
892 | - QMutexLocker locker( &m_mutex ); | |
893 | - | |
894 | 814 | return checkAbonePrivate( num ); |
895 | 815 | } |
896 | 816 |
@@ -102,8 +102,6 @@ namespace Kita | ||
102 | 102 | { |
103 | 103 | Q_OBJECT |
104 | 104 | |
105 | - QMutex m_mutex; | |
106 | - | |
107 | 105 | /* pointer of Thread class */ |
108 | 106 | Thread* m_thread; |
109 | 107 |
@@ -111,7 +109,6 @@ namespace Kita | ||
111 | 109 | KURL m_datURL; |
112 | 110 | bool m_broken; |
113 | 111 | ResDatVec m_resDatVec; |
114 | - int m_lock; | |
115 | 112 | |
116 | 113 | /* for caching */ |
117 | 114 | Access* m_access; |
@@ -140,7 +137,6 @@ namespace Kita | ||
140 | 137 | DatInfo( const KURL& url ); |
141 | 138 | ~DatInfo(); |
142 | 139 | void init(); |
143 | - void wait(); | |
144 | 140 | const KURL& url(); |
145 | 141 | |
146 | 142 | /* for caching */ |
@@ -151,11 +147,6 @@ namespace Kita | ||
151 | 147 | bool isLoadingNow(); |
152 | 148 | void stopLoading(); |
153 | 149 | |
154 | - /* lock, unlock */ | |
155 | - void lock (); | |
156 | - void unlock(); | |
157 | - int isLocked(); | |
158 | - | |
159 | 150 | /* string data */ |
160 | 151 | const QString& getDat( int num ); |
161 | 152 | const QString& getId( int num ); |
@@ -32,7 +32,6 @@ using namespace Kita; | ||
32 | 32 | #define DMANAGER_MAXQUEUE 16 |
33 | 33 | |
34 | 34 | DatInfoList DatManager::m_datInfoList; |
35 | -QMutex DatManager::m_mutex; | |
36 | 35 | |
37 | 36 | |
38 | 37 | /*-----------------------------------------------------------------------*/ |
@@ -90,8 +89,6 @@ DatInfo* DatManager::getDatInfo( const KURL& url, bool checkCached ) | ||
90 | 89 | without creating instance. */ /* private */ |
91 | 90 | DatInfo* DatManager::searchDatInfo( const KURL& url ) |
92 | 91 | { |
93 | - QMutexLocker locker( &m_mutex ); | |
94 | - | |
95 | 92 | KURL datURL = Kita::getDatURL( url ); |
96 | 93 | if ( datURL.isEmpty() ) return NULL; /* This url is not enrolled in BoardManager. */ |
97 | 94 | if ( m_datInfoList.count() == 0 ) return NULL; |
@@ -124,8 +121,6 @@ DatInfo* DatManager::searchDatInfo( const KURL& url ) | ||
124 | 121 | Note that DatInfo::DatInfo() opens cached data and reads it. */ /* private */ |
125 | 122 | DatInfo* DatManager::enrollDatInfo( const KURL& url, bool checkCached ) |
126 | 123 | { |
127 | - QMutexLocker locker( &m_mutex ); | |
128 | - | |
129 | 124 | KURL datURL = Kita::getDatURL( url ); |
130 | 125 | if ( datURL.isEmpty() ) return NULL; /* This url is not enrolled in BoardManager. */ |
131 | 126 |
@@ -149,13 +144,6 @@ DatInfo* DatManager::enrollDatInfo( const KURL& url, bool checkCached ) | ||
149 | 144 | |
150 | 145 | if ( ( *it ) == NULL ) continue; |
151 | 146 | DatInfo* deleteInfo = ( *it ); |
152 | - | |
153 | - if ( ! deleteInfo->isLocked() ) { | |
154 | - m_datInfoList.remove( it ); | |
155 | - --it; | |
156 | - deleteInfo->wait(); /* wait until DatInfo::m_mutex is released. */ | |
157 | - delete deleteInfo; | |
158 | - } | |
159 | 147 | } |
160 | 148 | } |
161 | 149 |
@@ -170,7 +158,6 @@ void DatManager::deleteAllDatInfo() | ||
170 | 158 | for ( it = m_datInfoList.begin(); it != m_datInfoList.end(); ++it ) { |
171 | 159 | |
172 | 160 | if ( ( *it ) == NULL ) continue; |
173 | - ( *it ) ->wait(); | |
174 | 161 | delete ( *it ); |
175 | 162 | } |
176 | 163 | } |
@@ -259,30 +246,6 @@ void DatManager::stopLoading( const KURL& url ) | ||
259 | 246 | return datInfo->stopLoading(); |
260 | 247 | } |
261 | 248 | |
262 | - | |
263 | - | |
264 | -/*----------------------*/ | |
265 | -/* lock, unlock DatInfo */ | |
266 | - | |
267 | -/* public */ | |
268 | -void DatManager::lock ( const KURL& url ) | |
269 | -{ | |
270 | - DatInfo * datInfo = getDatInfo( url ); | |
271 | - if ( datInfo == NULL ) return ; | |
272 | - | |
273 | - datInfo->lock (); | |
274 | -} | |
275 | - | |
276 | -/* public */ | |
277 | -void DatManager::unlock( const KURL& url ) | |
278 | -{ | |
279 | - DatInfo * datInfo = searchDatInfo( url ); | |
280 | - if ( datInfo == NULL ) return ; | |
281 | - | |
282 | - datInfo->unlock(); | |
283 | -} | |
284 | - | |
285 | - | |
286 | 249 | /*--------------------------------------*/ |
287 | 250 | /* string data */ |
288 | 251 |
@@ -13,7 +13,6 @@ | ||
13 | 13 | |
14 | 14 | #include <qvaluelist.h> |
15 | 15 | |
16 | -class QMutex; | |
17 | 16 | class KURL; |
18 | 17 | class QObject; |
19 | 18 | class QStringList; |
@@ -27,7 +26,6 @@ namespace Kita | ||
27 | 26 | class DatManager |
28 | 27 | { |
29 | 28 | static DatInfoList m_datInfoList; |
30 | - static QMutex m_mutex; | |
31 | 29 | |
32 | 30 | public: |
33 | 31 |
@@ -43,11 +41,6 @@ namespace Kita | ||
43 | 41 | static bool isLoadingNow( const KURL& url ); |
44 | 42 | static void stopLoading( const KURL& url ); |
45 | 43 | |
46 | - | |
47 | - /* lock, unlock */ | |
48 | - static void lock ( const KURL& url ); | |
49 | - static void unlock( const KURL& url ); | |
50 | - | |
51 | 44 | /* string data */ |
52 | 45 | static const QString& getDat( const KURL& url, int num ); |
53 | 46 | static const QString& getId( const KURL& url, int num ); |
@@ -22,7 +22,6 @@ using namespace Kita; | ||
22 | 22 | |
23 | 23 | |
24 | 24 | DownloadManager* DownloadManager::instance = NULL; |
25 | -QMutex DownloadManager::m_mutex; | |
26 | 25 | |
27 | 26 | |
28 | 27 | /* Download file. Return value is pointer of FileLoader. |
@@ -50,8 +49,6 @@ FileLoader* DownloadManager::download( const KURL& url, const QString& path, | ||
50 | 49 | const LoaderOption& option /* option user data */ |
51 | 50 | ) |
52 | 51 | { |
53 | - QMutexLocker locker( &m_mutex ); | |
54 | - | |
55 | 52 | /* to use SIGNAL & SLOT, create instance of DownloadManager here. */ |
56 | 53 | /* ( You CANNOT use SIGNAL & SLOT without instance. ) */ |
57 | 54 | if ( instance == NULL ) instance = new DownloadManager(); |
@@ -63,8 +60,6 @@ FileLoader* DownloadManager::download( const KURL& url, const QString& path, | ||
63 | 60 | /* public */ /* static */ |
64 | 61 | void DownloadManager::stopLoading( const KURL& url ) |
65 | 62 | { |
66 | - QMutexLocker locker( &m_mutex ); | |
67 | - | |
68 | 63 | if ( instance ) instance->stopLoadingPrivate( url ); |
69 | 64 | } |
70 | 65 |
@@ -66,7 +66,6 @@ namespace Kita | ||
66 | 66 | Q_OBJECT |
67 | 67 | |
68 | 68 | static DownloadManager* instance; |
69 | - static QMutex m_mutex; | |
70 | 69 | QPtrList< FileLoader > m_loaderList; |
71 | 70 | |
72 | 71 | public: |
@@ -33,7 +33,6 @@ | ||
33 | 33 | |
34 | 34 | namespace Kita |
35 | 35 | { |
36 | - static QMutex codecMutex; | |
37 | 36 | static QCp932Codec* qcpCodec = NULL; |
38 | 37 | static QTextCodec* utf8Codec = NULL; |
39 | 38 | static QTextCodec* eucCodec = NULL; |
@@ -61,9 +60,6 @@ namespace Kita | ||
61 | 60 | |
62 | 61 | QString Kita::qcpToUnicode( const QString& str ) |
63 | 62 | { |
64 | - | |
65 | - QMutexLocker locker( & Kita::codecMutex ); /* QTextCodec is not reentrant. */ | |
66 | - | |
67 | 63 | if ( !Kita::qcpCodec ) Kita::qcpCodec = new QCp932Codec(); |
68 | 64 | |
69 | 65 | return Kita::qcpCodec->toUnicode( str ); |
@@ -72,9 +68,6 @@ QString Kita::qcpToUnicode( const QString& str ) | ||
72 | 68 | |
73 | 69 | QString Kita::utf8ToUnicode( const QString& str ) |
74 | 70 | { |
75 | - | |
76 | - QMutexLocker locker( & Kita::codecMutex ); /* QTextCodec is not reentrant. */ | |
77 | - | |
78 | 71 | if ( !Kita::utf8Codec ) Kita::utf8Codec = QTextCodec::codecForName( "utf8" ); |
79 | 72 | |
80 | 73 | return Kita::utf8Codec->toUnicode( str ); |
@@ -83,8 +76,6 @@ QString Kita::utf8ToUnicode( const QString& str ) | ||
83 | 76 | |
84 | 77 | QString Kita::eucToUnicode( const QString& str ) |
85 | 78 | { |
86 | - QMutexLocker locker( & Kita::codecMutex ); /* QTextCodec is not reentrant. */ | |
87 | - | |
88 | 79 | if ( !Kita::eucCodec ) Kita::eucCodec = QTextCodec::codecForName( "eucJP" ); |
89 | 80 | |
90 | 81 | return Kita::eucCodec->toUnicode( str ); |
@@ -50,12 +50,6 @@ void KitaPreviewPart::clearPart() | ||
50 | 50 | { |
51 | 51 | slotDeletePopup(); |
52 | 52 | |
53 | - if ( !m_datURL.isEmpty() ) { | |
54 | - /* This part is opened. */ | |
55 | - | |
56 | - /* don't forget to unlock previous datURL here. */ | |
57 | - Kita::DatManager::unlock( m_datURL ); | |
58 | - } | |
59 | 53 | m_datURL = QString::null; |
60 | 54 | } |
61 | 55 |
@@ -67,9 +61,6 @@ bool KitaPreviewPart::setup( const KURL& url ) | ||
67 | 61 | |
68 | 62 | m_datURL = Kita::getDatURL( url ); |
69 | 63 | |
70 | - /* Lock datURL. Don't forget to unlock it later ! */ | |
71 | - Kita::DatManager::lock ( m_datURL ); | |
72 | - | |
73 | 64 | /* create HTML Document */ |
74 | 65 | createHTMLDocument(); |
75 | 66 |