added: to plugin thread: message WINIX_PL_THREAD_CAN_MAKE_REDIRECT
(similar as for ticket) git-svn-id: svn://ttmath.org/publicrep/winix/trunk@888 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
@@ -2,12 +2,14 @@
|
||||
* This file is a part of Winix
|
||||
* and is not publicly distributed
|
||||
*
|
||||
* Copyright (c) 2010, Tomasz Sowa
|
||||
* Copyright (c) 2010-2012, Tomasz Sowa
|
||||
* All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "threadinfo.h"
|
||||
#include "core/plugin.h"
|
||||
#include "pluginmsg.h"
|
||||
|
||||
|
||||
|
||||
@@ -43,6 +45,12 @@ void ThreadInfo::Clear()
|
||||
|
||||
Item * ThreadInfo::FindThreadDir()
|
||||
{
|
||||
Item * plugin_dir = 0;
|
||||
plugin.Call(WINIX_PL_THREAD_SEARCH_THREAD_DIR, &plugin_dir);
|
||||
|
||||
if( plugin_dir )
|
||||
return plugin_dir;
|
||||
|
||||
const std::wstring & dir_str = system->mounts.pmount->FirstArg(mount_par_thread_dir);
|
||||
|
||||
if( dir_str.empty() )
|
||||
@@ -132,6 +140,22 @@ void ThreadInfo::Repair()
|
||||
}
|
||||
|
||||
|
||||
|
||||
void ThreadInfo::MakeRedirectIfPossible(const Item & item)
|
||||
{
|
||||
PluginRes res = plugin.Call(WINIX_PL_THREAD_CAN_MAKE_REDIRECT);
|
||||
|
||||
if( res.res_false > 0 )
|
||||
{
|
||||
log << log4 << "Thread: redirect prevented" << logend;
|
||||
return;
|
||||
}
|
||||
|
||||
system->RedirectTo(item);
|
||||
}
|
||||
|
||||
|
||||
|
||||
} // namespace
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user