diff --git a/code/Application.cpp b/code/Application.cpp index 9f3bf25..f45cb72 100644 --- a/code/Application.cpp +++ b/code/Application.cpp @@ -85,7 +85,6 @@ Application::Application // warn that prefs are unreadable. itsWindowList = jnew JPtrArray(JPtrArrayT::kForgetAll); - assert( itsWindowList != nullptr ); *displayAbout = CreateGlobals(this); @@ -110,12 +109,10 @@ Application::Application JGetUserMountPointList(itsMountPointList, &itsMountPointState); itsShortcutList = jnew JPtrArray(JPtrArrayT::kDeleteAll); - assert( itsShortcutList != nullptr ); itsShortcutList->SetCompareFunction(CompareShortcuts); itsShortcutList->SetSortOrder(JListT::kSortAscending); itsMountPointPrefs = jnew JStringPtrMap(JPtrArrayT::kDeleteAll); - assert( itsMountPointPrefs != nullptr ); SetPrefInfo(GetPrefsMgr(), kSAppID); JPrefObject::ReadPrefs(); @@ -558,7 +555,6 @@ Application::AddShortcut ) { auto* s = jnew JString(JConvertToHomeDirShortcut(shortcut)); - assert( s != nullptr ); if (!itsShortcutList->InsertSorted(s, false)) { jdelete s; @@ -871,7 +867,8 @@ Application::DisplayAbout ForgetPrefsMgr(); JXGetApplication()->Quit(); } - }); + }, + "Application::DisplayAbout"); } /****************************************************************************** diff --git a/code/FileTreeList.cpp b/code/FileTreeList.cpp index 5176bdb..abcc846 100644 --- a/code/FileTreeList.cpp +++ b/code/FileTreeList.cpp @@ -71,7 +71,7 @@ FileTreeList::GetFileNode ) { auto* node = dynamic_cast(GetNode(index)); - assert (node != nullptr); + assert( node != nullptr ); return node; } @@ -83,7 +83,7 @@ FileTreeList::GetFileNode const { const auto* node = dynamic_cast(GetNode(index)); - assert (node != nullptr); + assert( node != nullptr ); return node; } diff --git a/code/FileTreeNode.cpp b/code/FileTreeNode.cpp index 267d835..c3169fc 100644 --- a/code/FileTreeNode.cpp +++ b/code/FileTreeNode.cpp @@ -92,7 +92,7 @@ FileTree* FileTreeNode::GetFileTree() { auto* tree = dynamic_cast(GetTree()); - assert (tree != nullptr); + assert( tree != nullptr ); return tree; } @@ -101,7 +101,7 @@ FileTreeNode::GetFileTree() const { const auto* tree = dynamic_cast(GetTree()); - assert (tree != nullptr); + assert( tree != nullptr ); return tree; } @@ -182,7 +182,7 @@ FileTreeNode::GetFileChild ) { auto* node = dynamic_cast(GetChild(index)); - assert (node != nullptr); + assert( node != nullptr ); return node; } @@ -194,6 +194,6 @@ FileTreeNode::GetFileChild const { const auto* node = dynamic_cast(GetChild(index)); - assert (node != nullptr); + assert( node != nullptr ); return node; } diff --git a/code/FileTreeTable.cpp b/code/FileTreeTable.cpp index 3b357e2..697d5f7 100644 --- a/code/FileTreeTable.cpp +++ b/code/FileTreeTable.cpp @@ -342,7 +342,6 @@ FileTreeTable::FileTreeTable })); itsShortcutsMenu = menuBar->AppendTextMenu(JGetString("MenuTitle::FileTreeTable_Shortcuts")); - assert (itsShortcutsMenu != nullptr); itsShortcutsMenu->SetMenuItems(kShortcutsMenuStr); itsShortcutsMenu->SetUpdateAction(JXMenu::kDisableNone); itsShortcutsMenu->AttachHandlers(this, @@ -356,7 +355,9 @@ FileTreeTable::FileTreeTable // updating - itsUpdateTask = jnew JXFunctionTask(kDirUpdateInterval, std::bind(&FileTreeTable::UpdateDisplay, this, false)); + itsUpdateTask = jnew JXFunctionTask(kDirUpdateInterval, + std::bind(&FileTreeTable::UpdateDisplay, this, false), + "FileTreeTable::UpdateDisplay"); JXWindow* window = GetWindow(); // if (!window->IsIconified()) // update window icon while iconified @@ -1869,8 +1870,7 @@ FileTreeTable::Receive { if (sender == itsRecentFilesMenu && message.Is(JXFSDirMenu::kFileSelected)) { - const auto* info = - dynamic_cast(&message); + auto* info = dynamic_cast(&message); assert( info != nullptr ); const JDirEntry entry(info->GetFileName()); @@ -1895,8 +1895,7 @@ FileTreeTable::Receive else if (sender == itsGitProcess && message.Is(JProcess::kFinished)) { - const auto* info = - dynamic_cast(&message); + auto* info = dynamic_cast(&message); assert(info != nullptr); if (info->Successful()) { @@ -1915,8 +1914,7 @@ FileTreeTable::Receive } else if (sender == itsIconWidget && message.Is(JXWindowIcon::kHandleDrop)) { - const auto* info = - dynamic_cast(&message); + auto* info = dynamic_cast(&message); assert( info != nullptr ); HandleDNDDrop(JPoint(0,0), info->GetTypeList(), info->GetAction(), info->GetTime(), info->GetSource()); @@ -1986,8 +1984,7 @@ FileTreeTable::ReceiveWithFeedback { if (sender == itsIconWidget && message->Is(JXWindowIcon::kAcceptDrop)) { - auto* info = - dynamic_cast(message); + auto* info = dynamic_cast(message); assert( info != nullptr ); info->ShouldAcceptDrop(WillAcceptDrop( info->GetTypeList(), info->GetActionPtr(), diff --git a/code/FindFileTask.cpp b/code/FindFileTask.cpp index 84bc701..7372cc8 100644 --- a/code/FindFileTask.cpp +++ b/code/FindFileTask.cpp @@ -26,9 +26,9 @@ bool FindFileTask::Create ( - TreeDir* dir, - const JString& path, - const JString& expr, + TreeDir* dir, + const JString& path, + const JString& expr, FindFileTask** task ) { @@ -50,7 +50,6 @@ FindFileTask::Create iter.Invalidate(); *task = jnew FindFileTask(dir, relPath, p, outFD, errFD); - assert( *task != nullptr ); return true; } else @@ -92,8 +91,6 @@ FindFileTask::FindFileTask ListenTo(itsDirector); itsPathList = jnew JPtrArray(JPtrArrayT::kDeleteAll); - assert( itsPathList != nullptr ); - SplitPath(relPath, itsPathList); itsDirector->GetTable()->GetFileTree()->Update(true); diff --git a/code/FolderDragSource.cpp b/code/FolderDragSource.cpp index 99c3556..dcbc957 100644 --- a/code/FolderDragSource.cpp +++ b/code/FolderDragSource.cpp @@ -52,7 +52,6 @@ FolderDragSource::FolderDragSource SetHint(JGetString("Hint::FolderDragSource")); itsPathMenu = jnew JXCurrentPathMenu(JGetRootDirectory(), this, kFixedLeft, kFixedTop, 0,0, 10,10); - assert( itsPathMenu != nullptr ); itsPathMenu->Hide(); itsPathMenu->SetToHiddenPopupMenu(true); *pathMenu = itsPathMenu; @@ -114,8 +113,6 @@ FolderDragSource::HandleMouseDrag list.Append(&const_cast(path)); auto* data = jnew JXFileSelection(GetDisplay(), list); - assert( data != nullptr ); - BeginDND(pt, buttonStates, modifiers, data); } } diff --git a/code/PrefsMgr.cpp b/code/PrefsMgr.cpp index b82ed3e..c9b26cb 100644 --- a/code/PrefsMgr.cpp +++ b/code/PrefsMgr.cpp @@ -177,8 +177,6 @@ PrefsMgr::EditPrefs() auto* dlog = jnew EditPrefsDialog(termCmd, manCmd, gitStatusCmd, gitHistoryCmd, coCmd, DelWillDelete(), WillOpenNewWindows(), WillSaveFolderPrefs()); - assert( dlog != nullptr ); - if (dlog->DoDialog()) { JString manCmd, termCmd, gitStatusCmd, gitHistoryCmd, postCheckoutCmd; diff --git a/code/TrashButton.cpp b/code/TrashButton.cpp index cd85352..18b4ba5 100644 --- a/code/TrashButton.cpp +++ b/code/TrashButton.cpp @@ -239,7 +239,6 @@ TrashButton::MoveFilesToTrash if (returnType == selManager->GetURLXAtom()) { auto* fileNameList = jnew JPtrArray(JPtrArrayT::kDeleteAll); - assert( fileNameList != nullptr ); JPtrArray urlList(JPtrArrayT::kDeleteAll); JXUnpackFileNames((char*) data, dataLength, fileNameList, &urlList); diff --git a/code/TreeDir.cpp b/code/TreeDir.cpp index b46340c..cbedf50 100644 --- a/code/TreeDir.cpp +++ b/code/TreeDir.cpp @@ -223,7 +223,6 @@ TreeDir::BuildWindow { input = jnew std::ifstream(prefsFile.GetBytes()); } - assert( input != nullptr ); JFileVersion vers = 0; JSize w, h; @@ -286,7 +285,6 @@ TreeDir::BuildWindow JXWidget::kHElastic, JXWidget::kVElastic, 0,0, 1000,1000); } - assert( itsTreeSet != nullptr ); // itsTreeSet has already called FitToEnclosure() ListenTo(GetTable()); @@ -295,7 +293,6 @@ TreeDir::BuildWindow auto* windowsMenu = jnew JXWDMenu(JGetString("WindowsMenuTitle::JXGlobal"), menuBar, JXWidget::kFixedLeft, JXWidget::kVElastic, 0,0, 10,10); - assert( windowsMenu != nullptr ); menuBar->AppendMenu(windowsMenu); if (JXMenu::GetDisplayStyle() == JXMenu::kWindowsStyle) { diff --git a/code/TreeSet.cpp b/code/TreeSet.cpp index ddea08d..33de662 100644 --- a/code/TreeSet.cpp +++ b/code/TreeSet.cpp @@ -154,7 +154,7 @@ void TreeSet::TreeSetX } auto* entry = jnew JDirEntry(path); - assert( entry != nullptr && JFSFileTreeNode::CanHaveChildren(*entry) ); + assert( JFSFileTreeNode::CanHaveChildren(*entry) ); auto* root = jnew FileTreeNode(entry); itsFileTree = jnew FileTree(root); auto* treeList = jnew FileTreeList(itsFileTree); @@ -167,22 +167,18 @@ void TreeSet::TreeSetX itsScrollbarSet, encl, kHElastic, kVElastic, 0, headerHeight, enclApG.width(), enclApG.height()-headerHeight); - assert( itsTable != nullptr ); ListenTo(itsFileTree->GetRootDirInfo()); - auto* colHeader = - jnew HeaderWidget(itsTable, itsScrollbarSet, encl, - kHElastic, kFixedTop, - 0,0, enclApG.width(), - headerHeight); - assert(colHeader != nullptr); + jnew HeaderWidget(itsTable, itsScrollbarSet, encl, + kHElastic, kFixedTop, + 0,0, enclApG.width(), + headerHeight); // header: filter itsFilterLabel = jnew JXStaticText(JGetString("FilterLabel::TreeSet"), this, kFixedLeft, kFixedTop, 5,0, 40, filterHeight); - assert( itsFilterLabel != nullptr ); itsFilterLabel->SetToLabel(); itsFilterHistory = @@ -195,7 +191,6 @@ void TreeSet::TreeSetX itsFilterInput = jnew FilterInput(itsTable, this, kHElastic, kFixedTop, 45,0, w - 45 - itsFilterHistory->GetFrameWidth(), filterHeight); - assert( itsFilterInput != nullptr ); itsFilterInput->SetFont(font); // footer: path input, drag source @@ -338,7 +333,6 @@ TreeSet::UpdateDisplay jnew JXTextButton(JGetString("EmptyTrashLabel::TreeSet"), encl, kFixedRight, kFixedTop, w - kEmptyButtonWidth, 0, kEmptyButtonWidth, kJXDefaultMenuBarHeight); - assert( itsEmptyButton != nullptr ); ListenTo(itsEmptyButton); } else if (!isTrashDir && itsEmptyButton != nullptr) diff --git a/code/globals.cpp b/code/globals.cpp index 1ea5f94..65671fb 100644 --- a/code/globals.cpp +++ b/code/globals.cpp @@ -109,17 +109,12 @@ CreateGlobals JXInitHelp(); - auto* wdMgr = jnew JXWDManager(app->GetCurrentDisplay(), true); - assert( wdMgr != nullptr ); + jnew JXWDManager(app->GetCurrentDisplay(), true); // registers itself - theMDIServer = jnew MDIServer; - - theManPageDialog = jnew ViewManPageDialog(JXGetPersistentWindowOwner()); - assert( theManPageDialog != nullptr ); - + theMDIServer = jnew MDIServer; + theManPageDialog = jnew ViewManPageDialog(JXGetPersistentWindowOwner()); theFindFileDialog = jnew FindFileDialog(JXGetPersistentWindowOwner()); - assert( theFindFileDialog != nullptr ); JString trashDir; GetTrashDirectory(&trashDir, false); // silently creates it @@ -541,17 +536,9 @@ GetDNDAskActions actionList->AppendItem(dndMgr->GetDNDActionMoveXAtom()); actionList->AppendItem(dndMgr->GetDNDActionLinkXAtom()); - auto* s = jnew JString(JGetString("DNDCopyDescription::globals")); - assert( s != nullptr ); - descriptionList->Append(s); - - s = jnew JString(JGetString("DNDMoveDescription::globals")); - assert( s != nullptr ); - descriptionList->Append(s); - - s = jnew JString(JGetString("DNDLinkDescription::globals")); - assert( s != nullptr ); - descriptionList->Append(s); + descriptionList->Append(JGetString("DNDCopyDescription::globals")); + descriptionList->Append(JGetString("DNDMoveDescription::globals")); + descriptionList->Append(JGetString("DNDLinkDescription::globals")); } /****************************************************************************** @@ -733,7 +720,7 @@ GetDirectorySmallIcon { JMountType type; JXImage* image; - if ((GetApplication())->IsMountPoint(path, &type) && + if (GetApplication()->IsMountPoint(path, &type) && GetMountPointSmallIcon(type, &image)) { return image; diff --git a/code/main.cpp b/code/main.cpp index ffa9b85..5ddf9cd 100644 --- a/code/main.cpp +++ b/code/main.cpp @@ -48,7 +48,8 @@ main GetMDIServer()->HandleCmdLineOptions(argc, argv); JXFSBindingManager::Initialize(); // notify user of any upgrades - }); + }, + "main->mdi"); if (displayAbout) { diff --git a/systemg.jcc b/systemg.jcc index 7355a81..73f80ad 100644 --- a/systemg.jcc +++ b/systemg.jcc @@ -1,4 +1,4 @@ -jx_browser_data 97 +jx_browser_data 98 # project tree 0 "root" T