QDirIterator jump last file

I work with QDirIterator to get a list of files in a directory, there are some questions I get well.

Ultimately it does not list the newest file,

It starts by listing the file just before the one he does not list.  So say there is 10 files, it starts with #9 and then past of 1 to 8 and 10 gets simply left out.

Is there a reason, the omission of this file and start with the input file list?

my code is

void ApplicationUI::iterator()
{
    qDebug() << "Iterator";
    QDir dirPath = QDir(QDir::homePath() + "/shared/music");

    QDirIterator myDirIt2(dirPath.absolutePath(), QDir::Files | QDir::AllDirs | QDir::NoDotAndDotDot, QDirIterator::Subdirectories);
    qDebug() << "dirPath2: " << dirPath.absolutePath();

        QDir mDir = QDir(myDirIt2.filePath());
        mDir.setFilter(QDir::Files | QDir::NoDotAndDotDot);
        qDebug() << mDir.dirName() << " file count " << mDir.count();

    while (myDirIt2.hasNext()) {
        if (myDirIt2.fileInfo().isFile()){
            qDebug() << "File Name: " << myDirIt2.fileName() << " - File Path: "  << myDirIt2.filePath();
        }
        myDirIt2.next();
    }
}

I have excluded as it is to the size of the file, or simply the file by adding another file, what County 11, he started with 10 (that it does not show before) and then from 1 to 9, leaving aside the 11

Yes, poor logic.

You are looking for the next record, but then doing research before moving, so your for loop ends always a beginning.

So when you get to 10, you do the following statement moving at 11, but then the while loop expression is convinced and ends do not get to your statement qDebug.

Change it to a do... while the easier change would be.

You must also have an if statement outside checking if the directories exist at all.

Tags: BlackBerry Developers

Similar Questions

  • How to stop the last file opened at startup?

    InDesign CS5 insists on reopening of the last file opened whenever I run the app, I had. I tried making sure that all documents are closed before leaving ID without success. I have looked through preferences but can't seem to find anything that changes. I'm on a Mac under Lion (10.7.4) and sought a solution to operating system level but haven't found anything, and no other application behaves like that. I search these forums and have not found an answer.

    Someone out there has an idea or is it an isolated case? Thank you.

    Mike

    Too bad. Found the answer-

  • __Is anyone with CS5 opens the last file automatically (whether they like it or not)?

    Is anyone else having CS5 opens the last file automatically (whether they like it or not)? -from time to time it seems this causes an accident as well!

    Is there a way to disable this option?

    This can help:

    http://www.Macworld.com/article/1166029/tame_lions_resume_features.html

  • Last file in sequence automatically load

    How can I configure TestStand 2012 so that the sequence that has been loaded, file last load automatically the next time that TestStand launches?

    UI best practices: http://www.ni.com/white-paper/7560/en/

    UI control: http://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=4&ved=0CDsQFjAD&url=http%3A%2F%2Fwww.ni...

    Hope this helps,

  • Continuous backup of statement he jumped a file that does not exist on the drive is not meant to save.

    I run Backup and get an error report that it has ignored files. He pointed out that he jumped a particular file on a disc "S". I have deleated this specific case a wile ago. The backup is supposed to DO NOT backup disc "S" anyway. How can I backup me to stop trying to save a file that no longer exists that where there it resides on a drive that backup was supposed to ignore?

    Hi John,.

    Thanks for posting the query on the Microsoft community.

    It seems that you are facing problems while performing the backup. It would be great if you can answer the following questions:

    1 have had any changes made on the computer before the show?

    2. What is the full and exact error message?

    Follow these methods to solve the problem:

    Method 1:

    First of all, I suggest you to refer to the article and see if it helps:

    Set up or change automatic backup settings

    http://Windows.Microsoft.com/en-us/Windows7/set-up-or-change-automatic-backup-settings

    Method 2:

    See the article and check if that helps:

    0x8100002F error code and or error code 0 x 80070002 when you back up files in Windows 7

    http://support.Microsoft.com/kb/979281

    If you have additional questions on the computer, please ask your question about Windows and we will be happy to help you.

  • Jump crazy file size, bug in yet

    Hi, Encore CS4 is my problem.

    I made a DVD for the year with a 20-minute film created in first. The 20-minute film has music and Visual countdown. The film is on DVD only three times (three different times), so that I can have a total of 65 tracks of subtitles on the three films - the subtitles tracks tell me what exercise is planned, and so there are 65 different workouts.

    During playback, I choose the subtitle tracks with three different menus, which are completely static - no animation, no music. Buttons to choose what subtitle track will be used and that the track audio (there are three different audio tracks).

    All this works fine, I have burned several copies of the disc, make menu settings bit here and there. There's almost a full space on the DVD concert when I do these discs. The problem is that this last time, I decided I want to export my project as a disc image, instead of burn directly to DVD. I will pause here to say that I used the function extract project just before the selection of the disk image, and there is no problem.

    As soon as I chose the export as a disk image, the size of the "DVD-ROM content" (menus, subtitles) which was previously about 350 KB, climbed up to more than 41 gigabytes. So now my project is too large to fit on a single DVD, of course, and I couldn't make it go down.

    It's crazy how it is. I recorded everything in a new project and systematically removed the entire project: three timelines, menus, subtitles, so that there was literally no content any left on the disc. The project always told it is large 41 gigabytes.

    So, is that nobody knows how to reset the file size counters, counters, I don't know even what to call... anything I don't have to rebuild from scratch? And Yes, I continued to use "Check project" and it keeps telling me that I have deleted parts of the project that it is still too big.

    Thank you

    Chris

    The ROM content is not the menus etc. This is a completely separate option to add the material to the disc which is not part of DVD playback.

    There is a bug for some users of Mac, but you got that from the beginning. So I suspect that when you changed a disk image and specified the location to save it to, you accidentally added something to the area of disc ROM If this is the case, simply remove the ROM section on the building Board, and you should be fine again.

    If it makes no sense to me, post a screenshot of the Panel generate.

  • How to recover a database after you add a data since the last file backup.

    How to recover a database after you add a data file to a tablspace existing since the last user managed backup.

    PS: I am aware that the user managed backups are not used and RMAN is used these days.

    At the stage of the mount: select name from v$ datafile;
    The last entry indicates a file named /xxx/xxx/.../UNNAMEDXXX.dbf

    Now

    ALTER database create datafile ' / xxx/xxx/.../UNNAMEDXXX.dbf' as 'path_where_you_want_to_add_the_datafile ';

    The name of the data file must match the name that added in production

    This will create a data file to the required location.

    Once the file has been created, you can continue with recovery.

  • Icon Firefox jumped above file. How can I get this back where it belongs

    Firefox icon allows to be to the left of the file and had a fall to the bottom of the box... now it's above file without the menu drop down. I want to go back to the left! How do I do that?
    I am running windows 8.

    You can attach a screenshot?

    Use a type of compressed as PNG or JPG image to save the screenshot.

    Aren't confuse you the menu button of Firefox and the Firefox icon in the Windows title bar?

    You get the orange Firefox menu button when the menu bar is hidden.

    • Firefox 3-bar menu button > Options/preferences
    • View > toolbars (press F10 to display the hidden menu bar)
    • Right click on empty toolbar space

    See also:

    28 Firefox still has the orange Firefox menu button.

    In Firefox 29 this button has been replaced by the Firefox 3 menu button bar on the right end of the Navigation bar.

  • Last file used

    I've noticed something lately which is really annoying. All applications I open starts with the last paper I used. Sometimes, there are 3 or 4 documents that open upwards. Is there a way to turn this "feature"?  I use my iMac with customers. I don't want a document private / photography opening when I access an app. Nothing seems to fit these days accept for the many glitches in the system.  I have recently reinstalled the operating system - once again. And I've completely wiped the hard drive and started from scratch.  I did a reset of the PR and I, double - triple checked my limited settings. What Miss me?

    I use OS X El Capitan (10.11.5) don't know why he repeats to me (iMac, OS X El Capitan (10.11.3))

  • Last files N in a table

    Hi Experts, how to extract the last N records from a table without altering the order of records?

    Thanks in advance...

    Hello

    2763326 wrote:

    Hello

    Sorry, I was on vacation and could not answer soon.

    I went through the discussion that happened. Thank you all for your time.

    I clarify my question as below:

    The emp table I get two last records i.e., registration of FORD and MILLER

    EMPNO, ENAME JOB MGR, HIREDATE SAL COMM DEPTNO

    ------ ---------- --------- ---------- --------- ---------- ---------- ----------

    7369 SMITH CLERK 7902 DECEMBER 17, 80 800 20
    7499 ALLEN SELLER 7698 FEBRUARY 20, 81 1600 300 30
    7521 WARD SELLER 7698 FEBRUARY 22, 81 1250 500 30
    7566 JONES MANAGER 7839 2 APRIL 81 2975 20
    7654 MARTIN SELLER 7698 28 - SEP - 81 1250 1400 30
    7698 BLAKE MANAGER 7839 1 MAY 81 2850 30
    7782 CLARK MANAGER 7839 JUNE 9, 81 2450 10
    7788 SCOTT ANALYST 7566 APRIL 19, 87 3000 20
    KING 7839 PRESIDENT NOVEMBER 17, 81 5000 10
    7844 TURNER SELLER 7698 08 - SEP - 81 1500 0 30
    7876 ADAMS CLERK 7788 MAY 23, 87 1100 20
    JAMES 7900 CLERK 7698 DECEMBER 3, 81 950 30
    7902 FORD ANALYST 7566 DECEMBER 3, 81 3000 20
    7934 MILLER CLERK 7782 JANUARY 23, 82 1300 10

    OUTPUT:

    7902 FORD ANALYST 7566 DECEMBER 3, 81 3000 20
    7934 MILLER CLERK 7782 JANUARY 23, 82 1300 10

    Is it possible to get this result from the discussion I see that oracle does not maintain insertion order unless you have a specific column to keep track of changes and insertions.

    Thanks in advance

    Ravi

    Of course; If you can tell which way these 2 rows are the last 2: can someone show you how do it.

    They are the last 2 in order by empno?  If so:

    WITH got_r_num AS

    (

    SELECT ename, empno, mgr, hiredate, sal, comm, deptno

    , EVALUATE () OVER (ORDER BY empno DESC) AS r_num

    FROM scott.emp

    )

    SELECT ename, empno, mgr, hiredate, sal, comm, deptno

    OF got_r_num

    WHERE r_num<=>

    ;

    Is this another thing that makes the last 2 rows?  If so, change the analytical ORDER BY clause.

  • When you rename a file change the last timestamp consulted?

    I was in a heated debate with one of my instructors today associated with a test on the access timestamp question when you rename a file. Through my research and testing to rename a file via the command prompt, it does not appear that the process of renaming a file will change the date of that last file access. Access and modify times will change to the directory that contains the file, but not the file itself.  So my understanding is that it is not, however, my instructor insists that it is, can someone shed some light on this topic please?

    Reading material more - it's interesting.

    More information under:

    Windows NT keeps track of three stamps of time associated with files and directories. These three temporal are written in creation, last access, and last. When a file or directory is created, accessible or changed, Windows NT updates the appropriate time stamp.

    http://support.Microsoft.com/kb/148126/a

    NTFS uses the change log to track information on the added files, deleted and changed for each volume.

    http://TechNet.Microsoft.com/en-us/library/cc938919.aspx

    Working with file systems

    http://TechNet.Microsoft.com/en-us/library/bb457112.aspx

  • Offline files Win7 "Sync failed with offline files. Interrupted offline files synchronization or just jump the incriminated files?

    I use offline files in Windows 7 on a corporate network.  Usually, it works very well, but sometimes, when someone else uses a file I get the message in sync results "Synchronization failed with offline files" and the files in question are wrong with the message "the process cannot access the file because it is being used by another process".  I want to know is was it interrupted the entire synchronization process or if it is complete and just jump the files in question?

    Hello

    That your computer is under domain, you must contact the technet forum, where we have of the support technicians who are well equipped with the knowledge on the issues of domain, do visit the link provided below.

    http://social.technet.Microsoft.com/forums/en-us/winserverfiles/threads

    Thanks and greetings

  • Media guide Center no longer updates and recent files no longer get listed on the jump list

    How can I fix Windows Media Center without reinstalling Windows

    I have several problems with my Windows Media Center since I moved files stored on another drive TV.wtv, although I can't be sure it was the movement that caused the problems. It is not the first time, I moved files TV registered to other readers and never had any problems before that for 2 more years, I use WMC.

    Here are the problems I've found so far:

    1. the Guide listings are no longer up-to-date. I can manually download updates without error, but the ads do not appear in the Guide.

    2 related Media Center system tray buttons make their appearance is no longer in the system tray. Even when a program is recording, there is no button red, hidden or visible, in the system tray.

    3. these last files no longer appear in the list of Media Center shortcuts in the Start Menu. The only item that appears on the list of shortcuts is 'TV Program Guide', which, as I said to the #1 updates any more.

    I am running Windows 7 Home Premium x 64

    The processes that appear to be related to the program are running are:

    ehtray.exe
    mcGlidHost.exe
    ehrecvr.exe

    Thank you.

    ignore all the other answers. a growing number of people have reported a problem with
    the EPG not updated. Please report your problem to
    http://connect.microsoft.com/site1145. You may need to register for the site
    before you can access the comments tab.
     
     
     
    Barb
     
    MVP - Windows/entertainment and connected home
     
     
    Please mark as answer if that answers your question
     
     
     
     
  • Identify the elements of L1 backup and restore the last control file

    DB version: 11.2
    Platform: Solaris 11

    We went to a database of development last month. But we kept backups rman Level0 and Level1 more archive logs generated after the last L1.
    Our N0 and N1 were planned with an interval of 4 days.

    The dev team now wants this DB restore in another machine. In a catalog schema, we did not keep the rman metadata. All we have is the backup pieces.
    stcdev_p4lor85q_1_1.bkp
    stcdev_yls3gkjl_3_7.bkp
    stcdev_mhfr8293_5_4.bkp
    stcdev_ipxsr8293_5_4.bkp
    .
    .
    .
    I don't know which of the backup are those who is from L0 and L1. If I managed to restore the last file to control the last backup of L1, then things will be easy. What happens if I am wrong to restore the old file of control of L0, which has no info on any new datafiles/tempfiles that I added after than L0.

    You guys, how such situations?

    After you restore the controlfile, simply ALTER DATABASE MOUNT, and delivers then a BACKUP of the LIST. The list will show you what knows the controlfile-if it shows the L0 and L1 of backups, you can use it. If it shows only the L0 backup, try to restore the 'other' controlfile.
    If you can see the timestamps of the backuppieces, which could help identify who's the backup "later."

    Hemant K Collette

  • InputFile component remembers the last downloaded file

    Hello

    JDeveloper 11.1.1.5

    I have a file download button in my page.
    File upload works fine, but the InputFile component seems to remember only the last file downloaded what so ever.
    It shows just the name of the file, but in fact, doesn't have the file associated with the component for the second time.

    For simplicity, I want the component to display an empty field always.

    So, I try before displaying the pop-up window to reset the component InputFile with the following code.
    But it still shows the name of file read-only.

    Code in the page...

    < af:inputFile label = "Select the CSV file" id = "if1" value = "#{pageFlowScope.workbookHelper.uploadedFile}" binding="#{pageFlowScope.workbookHelper.uploadedFileHandle}"/ > "

    The bean code...

    ....
    Private RichInputFile uploadedFileHandle;
    private UploadedFile-uploadedFile.
    .....
    public void showXPopup (ActionEvent actionEvent)
    {
    getUploadedFileHandle () .resetValue (); approach 1
    setUploadedFile (null); approach 2
    File UploadedFile = getUploadedFile();
    If (file! = null)
    leader. Dispose(); approach 3

    ADFUtils.invokePopup (getXPopup () .getClientId (FacesContext.getCurrentInstance ()));
    }
    ....

    Can you please tell me how to show component of the input file empty whenever the component is displayed in the pop-up window?

    Thanks for any help.
    Sameer

    Hello

    the input file is in an af:popup, so have you tried

    
    

    ?

    Another thing, to hide the frame supports a direct api:

    public void showPopup(ActionEvent event)
     {
       UIComponent source = (UIComponent) event.getSource();
       RichPopup popup = this.getPopup();
       RichPopup.PopupHints hints = new RichPopup.PopupHints();
       hints.add(RichPopup.PopupHints.HintTypes.HINT_ALIGN_ID, source)
            .add(RichPopup.PopupHints.HintTypes.HINT_LAUNCH_ID, source)
            .add(RichPopup.PopupHints.HintTypes.HINT_ALIGN, RichPopup.PopupHints.AlignTypes.ALIGN_AFTER_END);
       popup.show(hints);
     }
    

    And the binding of a UI component to a scope as 'pageFlowScope' is not a 'best practice' ;)

    Martin

Maybe you are looking for

  • tab page

    I got the new tab page when his shows across the top of the well site a site has been downloaded and now when I click to a new tab, it goes to a Web site and I don't want that I want it back to the tab new way how can I do?

  • Extremely slow start of satellite L50-B-235

    HelloMy laptop takes up to 4 hours to set market, when he actually decide to turn.I press the power button, the button lights up, I hear the fan starts working, but the screen remains black. After a few seconds, the fan calms down and that the power

  • cleaning iTunes music files on my new PC for Windows 10

    Hello, I've been a customer for many years iTunes and that you have now more than 1500 music files in a variety of folders to iTunes on my PC Windows 10. In fact, the number of unique music files is about 750.  I moved all my mp3 and m4a files unique

  • EA 6500: the best setting 2.5 GHz and 5 GHz

    Anyone know what is the best setting for the bands of 2.5 GHz and 5 GHz for the 6500 EA? I have the same SSID for two?  Should I leave the frequency and channel automatically for each 2.5 GHz and 5 GHz?

  • Print anywhere without hp e-print E-Mail?

    Hi, I have a HP Deskjet 3520. I wonder if it is possible to print anywhere (out of reach of the local network) without sending it to the email address (... @hpeprint.com)? For example, if I try to print a Web page on the go. Is it possible to send th