Browse Source

Minor cleaning up.

tags/2021-05-28
jules 12 years ago
parent
commit
3a5b51ef0d
2 changed files with 10 additions and 10 deletions
  1. +8
    -6
      modules/juce_gui_basics/commands/juce_ApplicationCommandManager.cpp
  2. +2
    -4
      modules/juce_gui_basics/filebrowser/juce_DirectoryContentsList.cpp

+ 8
- 6
modules/juce_gui_basics/commands/juce_ApplicationCommandManager.cpp View File

@@ -249,11 +249,13 @@ ApplicationCommandTarget* ApplicationCommandManager::findDefaultComponentTarget(
if (c == nullptr && Process::isForegroundProcess())
{
Desktop& desktop = Desktop::getInstance();
// getting a bit desperate now: try all desktop comps..
for (int i = Desktop::getInstance().getNumComponents(); --i >= 0;)
if (ApplicationCommandTarget* const target = findTargetForComponent (Desktop::getInstance().getComponent (i)
->getPeer()->getLastFocusedSubcomponent()))
return target;
for (int i = desktop.getNumComponents(); --i >= 0;)
if (ComponentPeer* const peer = desktop.getComponent(i)->getPeer())
if (ApplicationCommandTarget* const target = findTargetForComponent (peer->getLastFocusedSubcomponent()))
return target;
}
if (c != nullptr)
@@ -263,8 +265,8 @@ ApplicationCommandTarget* ApplicationCommandManager::findDefaultComponentTarget(
// still be passed up to the top level window anyway, so let's send it to the
// content comp.
if (ResizableWindow* const resizableWindow = dynamic_cast <ResizableWindow*> (c))
if (resizableWindow->getContentComponent() != nullptr)
c = resizableWindow->getContentComponent();
if (Component* const content = resizableWindow->getContentComponent())
c = content;
if (ApplicationCommandTarget* const target = findTargetForComponent (c))
return target;


+ 2
- 4
modules/juce_gui_basics/filebrowser/juce_DirectoryContentsList.cpp View File

@@ -211,10 +211,8 @@ bool DirectoryContentsList::checkNextFile (bool& hasChanged)
return true;
}
else
{
fileFindHandle = nullptr;
}
fileFindHandle = nullptr;
}
return false;


Loading…
Cancel
Save