Qt Creator - Searching files with Locator including folder - qt-creator

One quick question about QtCreator : I know it is possible to use the locator to quickly open files by using the "Ctrl-K" shortcut.
However, is it possible to search for files including their locations?
For example, let's say I want to quickly locate a file named "main.cpp" in a folder named "myfolder" and I have lots of other main.cpp files.
What should I type into the locator in order to quickly open it ?

Just type myfolder/main.cpp in the locator

Related

Is there any way to filter folders/directories by name in windows?

Is there any way to filter folders by Name in Windows?
Let's suppose I have 100 or 200 folders with different names in the directory.
Now I have a list of specific folder names that are in the folders and I want to filter/move those listed name folders to another directory.
In an easy word I want to copy/move listed folder names to another folder/directory.
How can I do that with any software in bulk? I am searching for it but I can't find any software to do this task for me. I can manually move the folder one by one but it's so time-consuming when I have hundreds of folders.
I am currently using XCOPY GUI software but in this software, I have to first filter the path exception folder before I get my final result.
Example:
Main Dir contains
1st folder
2nd folder
3rd folder
4th folder
and so on ...
I have a list of names in my notepad which folders I want to copy or move.
3rd folder,
4th folder
Final Dir:
3rd folder
4th folder
How can I do that in bilk using any software or any way?
Thanks
If you're using Java, you can use methods in the Files class, or instances of File.
For example, Files.move() might help. If you're using an IDE, type stuff that might be right, like Files.move(), and suggestions will pop up that might lead you down the right path. Also, you can look at the documentation. I am currently scraping the web and creating and filing files, so I know about this somewhat, although not specifically about moving folders rather than files. I'm using Java on a MacBook, so that might influence how relevant my suggestions are to you depending on what you're using.
Basically, look at the documentation for your language. You hopefully won't need any external libraries since moving folders should be a basic task.

Visual Studio Solution -- Any way to create a "special" folder?

Basically, I want one of my folders to appear above the other folders as a type of "special folder", similar to how Properties has it's own special place even though it's a folder, same with App_Data, etc.
Is this possible?
By default, Visual Studio doesn't support adding special project folders. The Properties folder is hard-coded to behave the way that it does.
However, anything is possible with code. You could build an extension to do this, but it wouldn't be simple. You'd probably need to mess around with the IVsHierarchy or even implement a project subtype.
Basically, I want one of my folders to
appear above the other folders as a
type of "special folder", similar to
how Properties has it's own special
place even though it's a folder, same
with App_Data, etc.
Is this possible?
Yes:
Do it manually through the IDE
Write your own script to
generate/modify your *.sln/*.vcproj
For (1) "manual" on solutions in the IDE: Solution Explorer, right-click on Solution node==>Add==>New Solution Folder.
While typically the folders are sorted alphabetically (I'd insert a leading underscore to force your special folder to the top), solution folders inserted manually on my MSVS2008 leave the new folder "at the top", even though it should have bumped down when alphabetically sorted. However, folders under a Project (which are called "Filters") are always sorted alphabetically, and added similarly from the right-click, and then you can modify their "filter properties" with file name globs for what you want in there (e.g., add a filter glob for "*.MY_EXTENSION1;*.MY_EXTENSION2").
We chose (2), and we generate our own *.sln and *.vcproj, adding our own folders/filters. I've not seen any utilities on the web to help with that (so we had to write our own). The formats are not too hard to reverse engineer, but it's largely undocumented XML, so you have to experiment. There are only a couple good web articles explaining what's in the file, like this one:
http://tim.oreilly.com/pub/a/dotnet/excerpt/vshacks_chap1/index.html?page=4
On the "bright side", the files are only XML, so in developing our scripts we merely made changes through the IDE, saved, and compared the "diffs" for what change we want. Those changes are what our scripts insert when we modify our files. So, if you modify the file manually, you can similarly just "diff" the file to see what changed, and make your own script. (IMHO, this is the fastest and easiest route, since tools generally do not exist to manipulate these files.)
Tools like CMake and QMake generate *.vcproj/*.sln, but don't really do the folder customization thing like you're talking. However, we look at their output too, because, "there's more than one way to do things" in these files, and the files seem to have many undocumented features for doing different clever things that somehow these tools have "discovered" (so you can try to copy their generated output).
We found the .NET APIs to work with these files as too much work, and not really designed for that type of manipulation, but YMMV.
VS 2012 has a feature that I just found, and it solved this problem for me. It may not be new to VS.
Create a folder under the project with a leading "_" (to get it sorted first).
On the folder's properties set "Namespace Provider" to false.
VS (or ReSharper?) code analysis then does not complain that "the namespace does not match file location", which was the source of irritation for me that would otherwise have kept me from going this route.
Although there is no easy way to add Custom Folder, there is an easy way to "steal" Properties custom folder.
Add a regular folder to the project. For example MyCustomerFolder.
Open proj file xml. Find line
<AppDesignerFolder>Properties</AppDesignerFolder>
replace with
<AppDesignerFolder>MyCustomFolder</AppDesignerFolder>
Reload the project.
Now you've got a custom folder, that will always stick to the top.

Creating a file bundle on OSX

For an application I would like to store a collection of files together, and have them appear in the filesystem as a single file so its easy to manage. I am currently storing everything in a folder.
I would like to keep things accessible so you can manually edit the inside contents if neccesary.
One way to do this would be to create a zip archive and give it a custom extension other then .zip. Then it appears as a filetype and if needed you can unpack and access the content, but for normal use keep it hidden.
I can't seem to find a convenient way to do this. Boost and zlib can do the compression but don't work with archives. I found libzip but I have a hard time understanding how to use it and to me it seems that it only reads/writes zip archives without doing the actual compression.
Is there a more convenient way to tackle this?
Can you call system functions for creating an archive on OSX from c++ / Carbon?
Is there another way to make a folder appear as a single file?
In OSX, you can create Document Packages (similar to application bundles) which are treated as a single file in the Finder, but are really just directories with some internal structure.
Apple does not zip these packages, but they do provide the functionality you describe and they can be created and accessed through CoreFoundation by using CFBundleRef .
From the documentation:
... The important thing to remember about creating a document package is that it is just a directory. As long as the type of the document package is registered (as described in “Registering Your Document Type”), all you have to do is create a directory with the appropriate filename extension. (The Finder uses the filename extension as its cue to treat the directory as a package.) You can create the directory (and create any files you want to put inside that directory) using the standard BSD file system routines ...
As 1st step, simple rename the folder and add the extension .bundle, e.g. Myappdir.bundle
That's will show the whole folder as one file with a lego-like bundle icon.
The next step is you must create one Info.plist file inside.

It is possible to navigate with Resharper/Visual Studio to external sources located on a hard drive on some directory?

I have some open source components used in different projects. And some times it requires me to take a look at some classes sources from those components.
I do not want to add their sources as a project to my solution to see the source code.
Is there a way to tell Resharper/Visual Studio to open source code from particular location on a hard drive for such a components?
Yes. If you have an assembly reference that also has a PDB with the correct path of the location of the source files, then using ReSharper (and I believe VS too) to navigate (e.g. F12/Go To Definition) would open up the source file in VS. Note that it will have reduced functionality as far as IntelliSense and tooltips go, as it's outside of the current solution and is not analyzed by the VS/R# tools. You will still be able to use F12 to jump to other solutions from that file.
The easiest way to make sure the PDB has the correct path is to build the components yourself, so that a PDB is created with local paths. If the PDB is missing or points at a non-existent path, R# will fall back to displaying class metadata (or the Object Browser, per your settings).

Skip the .xsd when searching

We use the built in table adapter wizard in VS2005 to build a portion of our app, resulting in an enormous .xsd file being generated.
It's never interesting to have this .xsd included when searching through code, so I would like to be able to skip it when using Visual Studio Find. Is this possible?
The only solution I could find is a workaround: Download the free baregrep program and use it to search your source directory. You can set baregrep to search only .vb files and even though it searches the designer files (which you probably do not want) you can see which source files you need to search individually. Baregrep is a really fine search program, handy to have on your machine.
Seems the best solution is to switch from Quick Find to Find In Files which gives us the "Look at these file types:" option. Instead of one of the defaults:
*.vb;*.resx;*.xsd;*.wsdl;*.xml;*.htm;*.html;*.css
Set it to just:
*.vb;

Resources