Skip to content

Commit

Permalink
Merge pull request '[win-nix] for bug 71691' (#100) from fix/bug-7169…
Browse files Browse the repository at this point in the history
…1 into hotfix/v8.2.2
  • Loading branch information
maxkadushkin committed Nov 23, 2024
2 parents e562504 + 02da8c8 commit 8f76bfb
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
8 changes: 8 additions & 0 deletions win-linux/src/cascapplicationmanagerwrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,14 @@ bool CAscApplicationManagerWrapper::processCommonEvent(NSEditorApi::CAscCefMenuE
CExistanceController::check(QString::fromStdWString(pData->get_Param()));
return true;
} else
if ( !(cmd.find(L"recent:forget") == std::wstring::npos) ) {
int id = m_private->recentFromViewId(event->get_SenderId());
if ( !(id < 0) ){
AscAppManager::sendCommandTo(SEND_TO_ALL_START_PAGE, "file:skip", QString::number(id));
}

return true;
} else
if ( !(cmd.find(L"system:changed") == std::wstring::npos) ) {
QRegularExpression re(":\\s?\"(dark|light)");
QRegularExpressionMatch match = re.match(QString::fromStdWString(pData->get_Param()));
Expand Down
18 changes: 18 additions & 0 deletions win-linux/src/cascapplicationmanagerwrapper_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,24 @@ class CAscApplicationManagerWrapper_Private
return m_appmanager.editorWindowFromViewId(viewid);
}

auto recentFromViewId(int viewid) -> int
{
CCefView * _cef = nullptr;
int _recent_id = -1;
while(true) {
_cef = m_appmanager.GetViewByRecentId(_recent_id);
if ( !_cef )
break;
else
if ( _cef->GetId() == viewid )
return _recent_id;

++_recent_id;
}

return -1;
}

auto openDocument(const COpenOptions& opts) -> bool
{
COpenOptions opts_ext{opts};
Expand Down

0 comments on commit 8f76bfb

Please sign in to comment.