~ubuntu-branches/ubuntu/wily/smb4k/wily

« back to all changes in this revision

Viewing changes to core/smb4khomesshareshandler.cpp

  • Committer: Package Import Robot
  • Author(s): Mark Purcell
  • Date: 2013-05-12 18:32:20 UTC
  • mfrom: (1.1.21)
  • Revision ID: package-import@ubuntu.com-20130512183220-21438imqygvny2wh
Tags: 1.0.6-1
* New upstream Release
* Add myself to Uploaders:

Show diffs side-by-side

added added

removed removed

Lines of Context:
316
316
  Q_ASSERT( share );
317
317
  Q_ASSERT( users );
318
318
  
319
 
  for ( int i = 0; i < m_homes_users.size(); ++i )
320
 
  {
321
 
    if ( QString::compare( share->unc(), m_homes_users.at( i ).share.unc(), Qt::CaseInsensitive ) == 0 &&
322
 
         ((m_homes_users.at( i ).share.workgroupName().isEmpty() || share->workgroupName().isEmpty()) ||
323
 
         QString::compare( share->workgroupName(), m_homes_users.at( i ).share.workgroupName(), Qt::CaseInsensitive ) == 0) )
324
 
    {
325
 
      *users = m_homes_users.at( i ).users;
326
 
      break;
327
 
    }
328
 
    else
329
 
    {
330
 
      continue;
331
 
    }
 
319
  if ( !m_homes_users.isEmpty() )
 
320
  {
 
321
    for ( int i = 0; i < m_homes_users.size(); ++i )
 
322
    {
 
323
      if ( QString::compare( share->unc(), m_homes_users.at( i ).share.unc(), Qt::CaseInsensitive ) == 0 &&
 
324
           ((m_homes_users.at( i ).share.workgroupName().isEmpty() || share->workgroupName().isEmpty()) ||
 
325
           QString::compare( share->workgroupName(), m_homes_users.at( i ).share.workgroupName(), Qt::CaseInsensitive ) == 0) )
 
326
      {
 
327
        *users = m_homes_users.at( i ).users;
 
328
        break;
 
329
      }
 
330
      else
 
331
      {
 
332
        continue;
 
333
      }
 
334
    }
 
335
  }
 
336
  else
 
337
  {
 
338
    // Do nothing
332
339
  }
333
340
}
334
341
 
340
347
  
341
348
  bool found = false;
342
349
  
343
 
  for ( int i = 0; i < m_homes_users.size(); ++i )
 
350
  if ( !m_homes_users.isEmpty() )
344
351
  {
345
 
    if ( QString::compare( share->unc(), m_homes_users.at( i ).share.unc(), Qt::CaseInsensitive ) == 0 &&
346
 
         ((m_homes_users.at( i ).share.workgroupName().isEmpty() || share->workgroupName().isEmpty()) ||
347
 
         QString::compare( share->workgroupName(), m_homes_users.at( i ).share.workgroupName(), Qt::CaseInsensitive ) == 0) )
348
 
    {
349
 
      m_homes_users[i].users = *users;
350
 
      found = true;
351
 
      break;
 
352
    for ( int i = 0; i < m_homes_users.size(); ++i )
 
353
    {
 
354
      if ( QString::compare( share->unc(), m_homes_users.at( i ).share.unc(), Qt::CaseInsensitive ) == 0 &&
 
355
           ((m_homes_users.at( i ).share.workgroupName().isEmpty() || share->workgroupName().isEmpty()) ||
 
356
           QString::compare( share->workgroupName(), m_homes_users.at( i ).share.workgroupName(), Qt::CaseInsensitive ) == 0) )
 
357
      {
 
358
        m_homes_users[i].users = *users;
 
359
        found = true;
 
360
        break;
 
361
      }
 
362
      else
 
363
      {
 
364
        continue;
 
365
      }
 
366
    }
 
367
  
 
368
    if ( !found )
 
369
    {
 
370
      m_homes_users << Smb4KHomesUsers( *share, *users );
352
371
    }
353
372
    else
354
373
    {
355
 
      continue;
 
374
      // Do nothing
356
375
    }
357
376
  }
358
 
  
359
 
  if ( !found )
360
 
  {
361
 
    m_homes_users << Smb4KHomesUsers( *share, *users );
362
 
  }
363
377
  else
364
378
  {
365
379
    // Do nothing
366
 
  }  
 
380
  }
367
381
}
368
382
 
369
383