Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
e4c7862b
Kaydet (Commit)
e4c7862b
authored
Şub 23, 2012
tarafından
Stephan Bergmann
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Adapted SearchThread/TakeThread to safer-to-use salhelper::Thread
üst
97355467
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
42 additions
and
31 deletions
+42
-31
Library_cui.mk
cui/Library_cui.mk
+1
-0
build.lst
cui/prj/build.lst
+1
-1
cuigaldlg.cxx
cui/source/dialogs/cuigaldlg.cxx
+26
-19
cuigaldlg.hxx
cui/source/inc/cuigaldlg.hxx
+14
-11
No files found.
cui/Library_cui.mk
Dosyayı görüntüle @
e4c7862b
...
...
@@ -56,6 +56,7 @@ $(eval $(call gb_Library_add_linked_libs,cui,\
jvmfwk \
lng \
sal \
salhelper \
sax \
sb \
sfx \
...
...
cui/prj/build.lst
Dosyayı görüntüle @
e4c7862b
cu
cui : svx sa
x NULL
cu
cui : salhelper sax sv
x NULL
cu cui usr1 - all cui_mkout NULL
cu cui\prj nmake - all cui_prj NULL
cui/source/dialogs/cuigaldlg.cxx
Dosyayı görüntüle @
e4c7862b
...
...
@@ -26,7 +26,11 @@
*
************************************************************************/
#include "sal/config.h"
#include <algorithm>
#include <cassert>
#include <ucbhelper/content.hxx>
#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
...
...
@@ -83,6 +87,7 @@ using namespace ::com::sun::star::uno;
SearchThread
::
SearchThread
(
SearchProgress
*
pProgess
,
TPGalleryThemeProperties
*
pBrowser
,
const
INetURLObject
&
rStartURL
)
:
Thread
(
"cuiSearchThread"
),
mpProgress
(
pProgess
),
mpBrowser
(
pBrowser
),
maStartURL
(
rStartURL
)
...
...
@@ -97,7 +102,7 @@ SearchThread::~SearchThread()
// ------------------------------------------------------------------------
void
S
AL_CALL
SearchThread
::
run
()
void
S
earchThread
::
execute
()
{
const
String
aFileType
(
mpBrowser
->
aCbbFileType
.
GetText
()
);
...
...
@@ -120,12 +125,7 @@ void SAL_CALL SearchThread::run()
ImplSearch
(
maStartURL
,
aFormats
,
mpBrowser
->
bSearchRecursive
);
}
}
// ------------------------------------------------------------------------
void
SAL_CALL
SearchThread
::
onTerminated
()
{
Application
::
PostUserEvent
(
LINK
(
mpProgress
,
SearchProgress
,
CleanUpHdl
)
);
}
...
...
@@ -227,7 +227,7 @@ SearchProgress::SearchProgress( Window* pParent, const INetURLObject& rStartURL
aFtSearchType
(
this
,
CUI_RES
(
FT_SEARCH_TYPE
)
),
aFLSearchType
(
this
,
CUI_RES
(
FL_SEARCH_TYPE
)
),
aBtnCancel
(
this
,
CUI_RES
(
BTN_CANCEL
)
),
maSearchThread
(
this
,
(
TPGalleryThemeProperties
*
)
pParent
,
rStartURL
)
parent_
(
pParent
),
startUrl_
(
rStartURL
)
{
FreeResource
();
aBtnCancel
.
SetClickHdl
(
LINK
(
this
,
SearchProgress
,
ClickCancelBtn
)
);
...
...
@@ -237,7 +237,10 @@ SearchProgress::SearchProgress( Window* pParent, const INetURLObject& rStartURL
void
SearchProgress
::
Terminate
()
{
maSearchThread
.
terminate
();
if
(
maSearchThread
.
is
())
{
maSearchThread
->
terminate
();
maSearchThread
->
join
();
}
}
// ------------------------------------------------------------------------
...
...
@@ -271,7 +274,10 @@ short SearchProgress::Execute()
void
SearchProgress
::
StartExecuteModal
(
const
Link
&
rEndDialogHdl
)
{
maSearchThread
.
create
();
assert
(
!
maSearchThread
.
is
());
maSearchThread
=
new
SearchThread
(
this
,
static_cast
<
TPGalleryThemeProperties
*
>
(
parent_
),
startUrl_
);
maSearchThread
->
launch
();
ModalDialog
::
StartExecuteModal
(
rEndDialogHdl
);
}
...
...
@@ -284,6 +290,7 @@ TakeThread::TakeThread(
TPGalleryThemeProperties
*
pBrowser
,
TokenList_impl
&
rTakenList
)
:
Thread
(
"cuiTakeThread"
),
mpProgress
(
pProgess
),
mpBrowser
(
pBrowser
),
mrTakenList
(
rTakenList
)
...
...
@@ -298,7 +305,7 @@ TakeThread::~TakeThread()
// ------------------------------------------------------------------------
void
SAL_CALL
TakeThread
::
run
()
void
TakeThread
::
execute
()
{
String
aName
;
INetURLObject
aURL
;
...
...
@@ -341,12 +348,7 @@ void SAL_CALL TakeThread::run()
pThm
->
UnlockBroadcaster
();
delete
pStatusProgress
;
}
}
// ------------------------------------------------------------------------
void
SAL_CALL
TakeThread
::
onTerminated
()
{
Application
::
PostUserEvent
(
LINK
(
mpProgress
,
TakeProgress
,
CleanUpHdl
)
);
}
...
...
@@ -359,8 +361,7 @@ TakeProgress::TakeProgress( Window* pWindow ) :
aFtTakeFile
(
this
,
CUI_RES
(
FT_TAKE_FILE
)
),
aFLTakeProgress
(
this
,
CUI_RES
(
FL_TAKE_PROGRESS
)
),
aBtnCancel
(
this
,
CUI_RES
(
BTN_CANCEL
)
),
maTakeThread
(
this
,
(
TPGalleryThemeProperties
*
)
pWindow
,
maTakenList
)
window_
(
pWindow
)
{
FreeResource
();
aBtnCancel
.
SetClickHdl
(
LINK
(
this
,
TakeProgress
,
ClickCancelBtn
)
);
...
...
@@ -371,7 +372,10 @@ TakeProgress::TakeProgress( Window* pWindow ) :
void
TakeProgress
::
Terminate
()
{
maTakeThread
.
terminate
();
if
(
maTakeThread
.
is
())
{
maTakeThread
->
terminate
();
maTakeThread
->
join
();
}
}
// ------------------------------------------------------------------------
...
...
@@ -449,7 +453,10 @@ short TakeProgress::Execute()
void
TakeProgress
::
StartExecuteModal
(
const
Link
&
rEndDialogHdl
)
{
maTakeThread
.
create
();
assert
(
!
maTakeThread
.
is
());
maTakeThread
=
new
TakeThread
(
this
,
static_cast
<
TPGalleryThemeProperties
*
>
(
window_
),
maTakenList
);
maTakeThread
->
launch
();
ModalDialog
::
StartExecuteModal
(
rEndDialogHdl
);
}
...
...
cui/source/inc/cuigaldlg.hxx
Dosyayı görüntüle @
e4c7862b
...
...
@@ -29,7 +29,9 @@
#ifndef _CUI_GALDLG_HXX_
#define _CUI_GALDLG_HXX_
#include <osl/thread.hxx>
#include "sal/config.h"
#include <salhelper/thread.hxx>
#include <vcl/dialog.hxx>
#include <vcl/graph.hxx>
#include <vcl/fixed.hxx>
...
...
@@ -75,7 +77,7 @@ struct FilterEntry
// - SearchThread -
// ----------------
class
SearchThread
:
public
::
osl
::
Thread
class
SearchThread
:
public
salhelper
::
Thread
{
private
:
...
...
@@ -87,15 +89,14 @@ private:
const
::
std
::
vector
<
String
>&
rFormats
,
sal_Bool
bRecursive
);
virtual
void
SAL_CALL
run
();
virtual
void
SAL_CALL
onTerminated
();
virtual
~
SearchThread
();
virtual
void
execute
();
public
:
SearchThread
(
SearchProgress
*
pProgess
,
TPGalleryThemeProperties
*
pBrowser
,
const
INetURLObject
&
rStartURL
);
virtual
~
SearchThread
();
};
// ------------------
...
...
@@ -111,7 +112,9 @@ private:
FixedText
aFtSearchType
;
FixedLine
aFLSearchType
;
CancelButton
aBtnCancel
;
SearchThread
maSearchThread
;
Window
*
parent_
;
INetURLObject
startUrl_
;
rtl
::
Reference
<
SearchThread
>
maSearchThread
;
DECL_LINK
(
ClickCancelBtn
,
void
*
);
void
Terminate
();
...
...
@@ -132,7 +135,7 @@ public:
// - TakeThread -
// --------------
class
TakeThread
:
public
::
osl
::
Thread
class
TakeThread
:
public
salhelper
::
Thread
{
private
:
...
...
@@ -140,8 +143,8 @@ private:
TPGalleryThemeProperties
*
mpBrowser
;
TokenList_impl
&
mrTakenList
;
virtual
void
SAL_CALL
run
();
virtual
void
SAL_CALL
onTerminated
();
virtual
~
TakeThread
();
virtual
void
execute
();
public
:
...
...
@@ -150,7 +153,6 @@ public:
TPGalleryThemeProperties
*
pBrowser
,
TokenList_impl
&
rTakenList
);
virtual
~
TakeThread
();
};
// ----------------
...
...
@@ -164,7 +166,8 @@ private:
FixedText
aFtTakeFile
;
FixedLine
aFLTakeProgress
;
CancelButton
aBtnCancel
;
TakeThread
maTakeThread
;
Window
*
window_
;
rtl
::
Reference
<
TakeThread
>
maTakeThread
;
TokenList_impl
maTakenList
;
DECL_LINK
(
ClickCancelBtn
,
void
*
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment